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?

Thanks

shalini23
—
2012-02-16T04:55:08Z —
#2

Hi..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..Shalini..

peppy
—
2012-02-16T22:40:31Z —
#3

Anyone know what might be causing this?

wonshikee
—
2012-02-16T23:08:36Z —
#4

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?

peppy
—
2012-02-16T23:23:57Z —
#5

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.

wonshikee
—
2012-02-17T00:47:50Z —
#6

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.

peppy
—
2012-02-17T00:59:36Z —
#7

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?

ServerStorm
—
2012-02-17T03:33:56Z —
#8

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

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.