Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pagination links are incorrectly cached when the website has multiple domains #499

Drewdan started this conversation in General
Discussion options

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

  • 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.

I have a fix in mind, and the PR will follow.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #407 on March 05, 2025 13:53.

AltStyle によって変換されたページ (->オリジナル) /