You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a website which has multiple domains, and subsequently multiple sessions, you might visit a page showing paginated resources, and the class which has the pagination data, such as the path for the links is cached. This means the baseURL for the pagination links is also cached, and won't change when the URL of the website changes.
For example:
go to mywebsite.com - and load a page with paginated data - the links will show with the correct URL
process to mywebsite.app - and loads the same page with paginated data - the links will show with the previous URL, not the current one.
Eloquent Query
Please provide the complete eloquent query that caused the bug, for example:
User::paginate();
Stack Trace
N.A
Environment
PHP: 7.4
OS: Windows 10, Ubuntu 20.04 (WSL) and AWS Llambdas
Laravel: 8.36.2
Model Caching 0.11.1
Additional context
This behaviour is not too unpleasant and quite edge casey, however, it does get confusing when a pagination link changes your domain from one to another, and then you lose your session.
This discussion was converted from issue #407 on March 05, 2025 13:53.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Describe the bug
If you have a website which has multiple domains, and subsequently multiple sessions, you might visit a page showing paginated resources, and the class which has the pagination data, such as the path for the links is cached. This means the baseURL for the pagination links is also cached, and won't change when the URL of the website changes.
For example:
go to mywebsite.com - and load a page with paginated data - the links will show with the correct URL
process to mywebsite.app - and loads the same page with paginated data - the links will show with the previous URL, not the current one.
Eloquent Query
Please provide the complete eloquent query that caused the bug, for example:
User::paginate();
Stack Trace
N.A
Environment
Additional context
This behaviour is not too unpleasant and quite edge casey, however, it does get confusing when a pagination link changes your domain from one to another, and then you lose your session.
I have a fix in mind, and the PR will follow.
Beta Was this translation helpful? Give feedback.
All reactions