Welcome Guest, Not a member yet? Register   Sign In
[RedirectClass] toReferrer

In my project is is likely users will open multiple tabs but continue navigating on the original tab. In this case, using redirect()->back() produces unexpected behavior. Example

  • user opens /list/
  • user opens /list/item/1 in a new tab (in background)
  • user posts form on /list
  • controller handles form posts and does a

  • user is now redirected back to /list/item/1 since it is the last visited url in the session
The behaviour of
is well documented and I understand the choice to use the session for safety.

However, would there be enough of a use case to add  a

function to cover the case I just described? Of course, this would be not much more than a convenience function as the functionality can already be achieved with other functions from the framework.

I would be happy to open a PR.

HTTP_REFERER is not reliable.
So if you want to use it, redirect()->to($referer) by yourself.

There is no need to use back() or referer in the first place.
You can just specify the URI in the controller.

Theme © iAndrew 2016 - Forum software by © MyBB