runnerjp Posted May 10, 2008 Share Posted May 10, 2008 hey guys.. for some reaosn i can only stay logged in for so long..after this i get logged out is this something to do with sessions and can it be changed? Link to comment https://forums.phpfreaks.com/topic/105053-solved-logging-only-for-so-long/ Share on other sites More sharing options...
p2grace Posted May 10, 2008 Share Posted May 10, 2008 Sessions do expire, the lifetime is set in the php.ini file. Try adding this to your script right before you start the sessions, if it doesn't work you'll need to edit your php.ini file. <?php ini_set('session.cookie_lifetime', 0); ini_set('session.cache_expire', 0); session_start(); header("Cache-control: private"); ?> Link to comment https://forums.phpfreaks.com/topic/105053-solved-logging-only-for-so-long/#findComment-537743 Share on other sites More sharing options...
runnerjp Posted May 10, 2008 Author Share Posted May 10, 2008 ok im in my php.ini file.... what ios it that i need to change lol Link to comment https://forums.phpfreaks.com/topic/105053-solved-logging-only-for-so-long/#findComment-537748 Share on other sites More sharing options...
p2grace Posted May 10, 2008 Share Posted May 10, 2008 The session.cookie_lifetime and the session.cache_expire just like I showed you in my example. the only difference is that you're not making the change in the php code, but rather actually changing the ini settings in the php.ini file. Link to comment https://forums.phpfreaks.com/topic/105053-solved-logging-only-for-so-long/#findComment-537749 Share on other sites More sharing options...
runnerjp Posted May 10, 2008 Author Share Posted May 10, 2008 ahh ok done it ty Link to comment https://forums.phpfreaks.com/topic/105053-solved-logging-only-for-so-long/#findComment-537752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.