I have the following variables set for sessions in my PHP application:
ini_set('session.cache_expire', 200000);
ini_set('session.cache_limiter', 'none');
ini_set('session.cookie_lifetime', 94608000);
ini_set('session.gc_maxlifetime', 94608000);
ini_set('session.save_handler', 'user');
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid', 0);
When I login via my laptop (Chrome, Safari or Firefox) I am never logged out (at least not for 3 years as set above). But when I login on my iPad I am logged out every week, and sometimes multiple times per week.
I have tried using debug on my mac, deleting the cookies, inspecting the sessions cookies, etc. They all have proper expire dates (Feb 2016) but yet I am still logged out.
It seems that the iPad ignores the cookie_lifetime variable.
Anyone run into this problem before? Any ideas?
Maybe this is a bug, maybe not. But I have run into the same issue as you. The workaround I used is :
session_start();
$lifetime = 94608000;
setcookie(session_name(),session_id(),time()+$lifetime);
Works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With