I have a php site where members log in and post classified ads. A member is complaining that they are occasionally getting booted off in the middle of making a post. I'm not sure why this is happening.
Could it have something to do with my connection being: mysql_pconnect ?
Are too many people using the site for persistent connection to be used and members are being booted out?
I have also a problem that happen with u and I m so confused for this..I don't understand, what I m doing for this..
Have a nice day..
Anyone know what might be causing this?
Is the session data being stored in the database?
That would make sense then with persistent connection, but why is it using that in the first place?
As far as I know, the session data is not stored in the database, it must be on my shared hosting server or something.
I am using persistent connection because I am using Dreamhost. They have a system set up called "conqueries", where one connection is equal to 25 queries of resources. So I set up persistent connection to conserve resources. They said this rule isn't important now like it was years ago, but they are still recording it in their statistics...
So would changing "mysql_pconnect" to "mysql_connect" actually solve this issue and prevent people from randomly being logged out? Also, I am getting about 1000 visitors per day.
If the session data is not stored in the database, it should have nothing to do with persistent connections (in theory).
Things you want to check for are session cookie's lifetime, or a remote possibility could be if you still have register_globals on and somehow it's being overriden. Or it could just be a logical error in the code that's causing them to kill the session.
I noticed that I have an item inside my listing page with an iframe that opens up a php file. This file did not have "session_start();" in it. Could this alone cause the user to lose their session?
It rarely ever happens, the page is used a lot and I've never witnessed it myself, but maybe the user clicked in the iframe or something?
@peepy Issuing session_start() after a session is already started will simply trigger a warning. It is likely that the apache directives plus the server time and the user's browser time are causing the early boot.
These are the apache directives:
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
The session.gc_maxlifetime is in seconds. If the server time and the browser time were off by 9 minutes then a user would be logged in for only 1 minute before the auto disposal of the session happens, killing their logged in state.
You need to decide how you will control this. For example you could set an unlimited session time and then manually control deletion of the session when a user logs out, inactivity occurs for a xxx length of time or whatever criteria you want.
Hope this helps,
This topic is now closed. New replies are no longer allowed.