djdealer Posted May 21, 2009 Share Posted May 21, 2009 Hi! I have problem with sessions (i think)! I need that when user log in, he stay in my wb for 24 hours, but all my users time to time get loged out after hour, 30min or 1min (in any time and i think all users at the same time) I use .htaccess to set values for session. Here is a peace from .htaccess: php_value session.save_path "/home/mysite/tmp/sessions" php_value session.cookie_lifetime 86400 php_value session.cache_expire 1440 php_value session.gc_maxlifetime 86400 php_value session.gc_probability 1 php_value session.gc_divisor 100 Is there all right if i need session for 24hours? Why all users get logged out before time? tnx for help! =] Quote Link to comment Share on other sites More sharing options...
CarbonCopy Posted May 21, 2009 Share Posted May 21, 2009 Sessions are always cleared when the user clears their temp. history/files, when they exit their browser software, and sometimes, depending on browser and user settings, when they close their current window/tab. Please give us more information such as if you are doing the testing, and do you get logged out after doing or visiting a specific page? Quote Link to comment Share on other sites More sharing options...
djdealer Posted May 21, 2009 Author Share Posted May 21, 2009 apart from witch page i visit, it log me out. when i close tab or my browser and go again to my page, i still be logged in (that i need). some time i can be logged in all night, but some time i log in and after some seconds i get logget out. i tested page with friends, and we all get logged out in same time. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 A) Are you on a shared web sever? B) Is php running as an Apache server module or as a CGI application? What is your web server (Apache, IIS...)? C) Have you checked using a phpinfo(); statement that the settings you have put into the .htaccess file are actually in effect? D) What does a phpinfo() statement show for the session.auto_start setting? E) In which folder is your .htaccess file and have you confirmed that the settings are in effect in all the folders that you have scripts in? Quote Link to comment Share on other sites More sharing options...
djdealer Posted May 21, 2009 Author Share Posted May 21, 2009 a) i buy hosting (for 3 months) at hosting24.com b) actually i don`t know (i don`t know to much about hostings), but i found in my hosting account information this: Apache version 2.2.11 (Unix). c) yes i check and all values are in effect d) session.auto_start OFF (i use start_session() in every page) e) i keep .htaccess in same folder where i have all pages of my web. (i don`t know hot to confirm that the the settings are in effect in all the folders) Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 21, 2009 Share Posted May 21, 2009 If multiple visitors get logged out at the same time, it is likely a problem on the server. Start by checking your web server log file for any error messages at the time someone gets logged out. You could have a bug in your code that is causing the information that says a visitor is logged in to be cleared. You would need to provide the relevant information for anyone else to be able to help with what your code is doing. How are you determining if a visitor is logged in? The existence of a session variable? A value in a database table? What is your normal code that logs someone out? Do you have a user system with an administrative function that can log users out? What php version? There could be a bug in php. Is any of your php code directly accessing the session files in any way (assuming it is the existence of a session variable that says someone is logged in) - counting logged in visitors? Are you using the built-in session file save handler? Quote Link to comment Share on other sites More sharing options...
djdealer Posted May 22, 2009 Author Share Posted May 22, 2009 PHP version 5.2.9! to count and determining if user is logged in i use database table. yes, i use the built-in session file save handler. before i buy this host i use free hosting, and on that hosting my page work fine. maybe bug is in latest scripts i have write. but tnx, now i know where to search for problem. 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.