Setting Session Time Out In htaccess File

I am on a shared virtual Apache Red Hat web server and I wanted to extend the default session time-out value for my site. I don’t manage the server and have to reserve server-wide requests to very important things so as not to “cry wolf” with gentleman who runs the server (which is not something I want to do).

When I set out on the search engines, all of the initial results were forums with self-proclaimed web geniuses chastising users not unlike myself for asking how to change session time out. Making users aware of the risks and downside of a change they are trying to make is great and a value-add, but the attitude about it and then not answering the question asked is just obnoxious and arrogant.

I do recognize the security vs. convenience trade off around extended session time outs, but I am not looking to eliminate session time out and I’m willing to accept a little more risk for a little more convenience.

I tried a couple of different phrasings for my search query and found this forum thread, which was very helpful. It very clearly asks my question and another user very clearly answered it. A bonus item in that thread was an echo statement to view what is set in the session time out cookie.

I just made the change, so we’ll see how it works out.

Feb 5th Update

This strategy does not seem to be working and the session time out seems very inconsistent. I’m not sure if other sites I visit concurrently battle each other on session status/time-out and/or if something is overriding the implementation described above. I’ll have to go back to the drawing board on this one…

Tags:
If you like this post and would like to receive updates from this blog, please subscribe our feed. Subscribe via RSS

One Response to “Setting Session Time Out In htaccess File”

  1. jimmckenna Says:

    I’m thinking the shared virtual web server is the cause of the inconsistent session time-outs. My understanding is the session data is removed during garbage collection. With shared virtual web servers if all the virtual web servers use the same directory to store session data then the other web servers could have different time-out parameters thus causing the inconsistency by removing your session data. To insure this does not happen add your own directory for session data using session-save_path. Example: php_value session.save_path /var/www/vhosts/w303/tmp/

Leave a Reply