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?
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.
@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.