Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

Looks like this issue is similar:

http://laravel.io/forum/06-03-2014-multiple-ajax-requests-causing-session-persistance-to-fail

A new session file is created, which could destroy the logout I attempted.

I suppose I could set async to false, but that drastically increases the end load time of everything, which isn't ideal. Is there another work around to this?

Async to false doesn't work either. The loop making all of the async jquery calls is in a .each which I can't kill on click.

Another solution would be to change the session type from file to cookie on the particular route I'm running. I'm going to try this on a before filter, though I suspect, based on going through the framework, the session data will already be writing before the routes filter is run.

Last updated 9 years ago.
0

Found a passable solution. In setting up my session driver, I check for the path and set the driver to array if it matches the path:

'driver' => Request::path() === 'dashboard/panel' ? 'array' : 'file',

It's passable in my sense because there is no sensitive data in the dashboards and nothing that requires other session data. It won't work if you want to restrict it to an authenticated user (because the user isn't in the array session).

It's not ideal, but in my case it works fine.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

dawgbone dawgbone Joined 27 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.