What you are doing is fundamentally flawed anyway since a user can have two browser tabs open, on the same session, and on totally different pages.
Jul 25, 2017
4
Level 6
How to check whether a route(URL) is an asset route?
I have a session variable in a BaseController's constructor to store current route. The code is like this:
if (!request()->ajax()) {
session()->put('current_url', request()->fullUrl());
}
But sometimes, I got asset URL like this in the session value:
https://laravel.dev/favicon.ico
I checked url()->full() but its implementation is the same:
/**
* Get the full URL for the current request.
*
* @return string
*/
public function full()
{
return $this->request->fullUrl();
}
How can I get the current full URL (exclude asset routes) or how can I know whether a route is an asset route or not?
Thanks!
Level 122
because your .htaccess file will forward requests for missing objects to your index.php file. This in turn will send back a 404 error because you have no route for favicon.ico
If you had a favicon this particuar issue would not happen
Please or to participate in this conversation.