frankerpulten Posted July 7, 2009 Share Posted July 7, 2009 Hi, I don't have access to the configuration file for the server, so i tried to change the session timeout by creating a file called php.ini and placing it in the specific folder for the site. Here's the file code: register_globals = on session.save_path = "/mnt/w9999/.phpsessions" upload_tmp_dir = "/tmp/" upload_max_filesize = 20000000 post_max_size = 20000000 zend_extension = /usr/local/nf/share/ioncube/ioncube_loader_fre_4.4.so session.gc_maxlifetime = 3600 This didn't seem to work. The session still times out for users after 24 minutes. Any hints or help would be awesome Quote Link to comment Share on other sites More sharing options...
p2grace Posted July 7, 2009 Share Posted July 7, 2009 Try this in a php file that is always included on your site: <?php ini_set('session.gc_maxlifetime',30); ini_set('session.cookie_lifetime',30); ?> Quote Link to comment Share on other sites More sharing options...
frankerpulten Posted July 7, 2009 Author Share Posted July 7, 2009 Hi thanks for your reply. My php code now looks like this: <?php session_start(); ini_set('session.gc_maxlifetime',3600); ini_set('session.cookie_lifetime',3600); ?> on the page that users are on while running a flash application. I tested it and the session still seems to time out after 24 minutes though. Any ideas? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 7, 2009 Share Posted July 7, 2009 Because those two values affect what session_start() does, they must be set before the session_start() statement. You must also set them before every session_start() statement that is in your code. Quote Link to comment Share on other sites More sharing options...
frankerpulten Posted July 12, 2009 Author Share Posted July 12, 2009 Alright, so I put <?php ini_set('session.gc_maxlifetime',3600); ini_set('session.cookie_lifetime',3600); session_start(); on every page that calls upon the session. It's still expiring after 24 minutes though. I'm kinda stumped. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 12, 2009 Share Posted July 12, 2009 Are you on a shared web server and do you still have the following setting in place (is that valid path as well?) - session.save_path = "/mnt/w9999/.phpsessions" What does a phpinfo(); statement show for the session.save_path? Quote Link to comment Share on other sites More sharing options...
frankerpulten Posted July 12, 2009 Author Share Posted July 12, 2009 Yah it is a shared web server. and session.save_path is /mnt/w9999/.phpsessions Should I change that? Btw, in phpinfo it says that session.gc_maxlifetime is 3600 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 12, 2009 Share Posted July 12, 2009 On a shared web server, when the session.save_path is the common default location, the shortest session.gc_maxlifetime of all the accounts is what gets used to delete the old session data files. You need to set session.save_path to be to a private folder within your account's folder tree in order to get your session settings to apply to just your session data files. Create a folder of your own and set the session.save_path to match that folder. You must set the session.save_path before every session_start(). Setting it globally in a local php.ini file would be the best way to set it. Quote Link to comment Share on other sites More sharing options...
frankerpulten Posted July 12, 2009 Author Share Posted July 12, 2009 I get this error now that I've changed the session save path : Warning: session_start() [function.session-start]: open(/www/mysite.ca/myfolder/session/sess_9ff691f817defdbbf5b32fffc39d5f64, O_RDWR) failed: No such file or directory (2) in /mnt/w0803/d01/s19/b02e13a5/www/mysite.ca/myfolder/consent2.php on line 8 I created a folder called session in the folder of my web site. Thanks for all your help so far. I'm pretty new to php. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 12, 2009 Share Posted July 12, 2009 Based on the path listed in the error message for your script - /mnt/w0803/d01/s19/b02e13a5/www/mysite.ca/myfolder/ The path to the session folder is probably - /mnt/w0803/d01/s19/b02e13a5/www/mysite.ca/myfolder/session/ Quote Link to comment Share on other sites More sharing options...
frankerpulten Posted July 14, 2009 Author Share Posted July 14, 2009 thanks, that totally worked! You rock! Quote Link to comment 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.