stockton Posted May 8, 2008 Share Posted May 8, 2008 I have php 5.0.3 installed on Windows Server 2003 SP1 running Apache and even though I have set the session timeout to 3600 seconds my users are getting timed out within a couple of minutes. Please tell me how to fix this. Quote Link to comment https://forums.phpfreaks.com/topic/104715-session-timeout/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 8, 2008 Share Posted May 8, 2008 Show exactly what setting you changed, where you changed it, what syntax you used and have you checked the actual runtime value using a phpinfo(); statement? Also, what exactly are the symptoms? What are they doing and what is happening that tells you the session is not working? Quote Link to comment https://forums.phpfreaks.com/topic/104715-session-timeout/#findComment-535959 Share on other sites More sharing options...
stockton Posted May 8, 2008 Author Share Posted May 8, 2008 We changed session.gc_maxlifetime in the php.ini using session.gc_maxlifetime=3600 & restarted Apache & yes we checked phpinfo(). The user signs in and does one or two things from a menu and then might leave the system for a minute or two and when they come back to it by clicking on a menu item they are told to logon to effect that choice & I can only assume that they have been timed out by the system. I have the same configuration working fine on my Windows XP machine as well as under Linux Ubuntu. BTW My current setup also works on Windows Server 2003 SP2. Quote Link to comment https://forums.phpfreaks.com/topic/104715-session-timeout/#findComment-536018 Share on other sites More sharing options...
PFMaBiSmAd Posted May 8, 2008 Share Posted May 8, 2008 The only way that the garbage collection setting could be causing this symptom after a short period of time would be if this was occurring 3600s/60minutes after the session was first created AND the file system was not updating the time on the file each time the file is updated. Since, this is unlikely (everyone would have heard about it), what is more likely to be happening is either the hostname or path is changing and the session cookie parameters are not setup to work outside of the hostname or path where the session was started. I recommend comparing all the session settings between one of your systems where this works and the one where it does not. The two most likely candidates are session.cookie_path and session.cookie_domain. It is also possible that if you are switching between relative URL's and absolute URL's and session.use_trans_sid is on that the session id is changing from using a cookie to using the parameter on the end of the URL and something like URL rewriting is preventing the session id from propagating between pages. Quote Link to comment https://forums.phpfreaks.com/topic/104715-session-timeout/#findComment-536041 Share on other sites More sharing options...
PFMaBiSmAd Posted May 8, 2008 Share Posted May 8, 2008 Here is another possibility - output buffering is enabled in php.ini on the system(s) where this works and not on the system where it does not work AND either the code is outputting content before session_start() or a file(s) got saved in UTF-8 format and the BOM is being output to the browser. There are a bunch of different conditions that could cause sessions to not work. You need to investigate similarities and differences between the servers where it does and does not work. You also need to pin down any repeatable conditions, such as does it occur going to one particular page... Quote Link to comment https://forums.phpfreaks.com/topic/104715-session-timeout/#findComment-536048 Share on other sites More sharing options...
stockton Posted May 9, 2008 Author Share Posted May 9, 2008 Thank you. We will do more investigation. Quote Link to comment https://forums.phpfreaks.com/topic/104715-session-timeout/#findComment-536510 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.