Session expiring before expiration period. |
My sessions seem to be expiring before their expiration period. I've researched this quite a lot and am unable to resolve it. I thought may it was down to Asynchronous ajax calls (session race condition) so I extended the session class via MY_Sesssion.php to only regenerate the session if it's not an AJAX call.
I've included both that function and my config below. I'm using CI version 3.1.7 PHP Code: class MY_Session extends CI_Session { Config: PHP Code: $config['sess_expiration'] = 7200; //= 2 hours
Hi rhodium, thanks for the response.
MySQL global time zone is UTC, session time zone is Europe/London. PHP date_default_timezone_set: Europe/London date.timezone: Europe/London So yes, I believe so.
You can follow this link https://stackoverflow.com/questions/5500...s-expiring this may help you.
(08-17-2018, 07:18 AM)Susan Burling Wrote: You can follow this link https://stackoverflow.com/questions/5500...s-expiring this may help you. Appreciate the help, but have already read that. This is essentially my last port of call as I've googled it to death.
Just following on from this. I believe this is my issue: https://github.com/bcit-ci/CodeIgniter/issues/154
Originally only on AJAX calls, but I can reproduce the issue by session sess_time_to_update to a low value, and opening several tabs which causes simultaneous requests.
(08-29-2018, 04:12 AM)alan1o Wrote: Just following on from this. I believe this is my issue: https://github.com/bcit-ci/CodeIgniter/issues/154 Have you tried using session_write_close() as described in the session documentation "A note about concurrency"? It's a singularly useful call inside ajax requests. |
Welcome Guest, Not a member yet? Register Sign In |