Re: dreaded sessions

From: Date: Mon, 19 Jan 2004 22:38:37 +0000
Subject: Re: dreaded sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-175085@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt Horner wrote:
|     Simply here is my problem:
|
|     After logging into the system, I set a session with information for
| the Username and Password for verifiying
|     the user's login into the system, that way I don't have to
| continually ask for the information or pass
|     in the forms.
|
|     Currently I am using a database to store sessions, which I have
| however encountered the same errors with file
|     based sessions.  When I restart the session, it performs a selection
| from the database on SESS ID. However,
|     in very consistently inconsistent points the selection returns 0
| results. However, I checked the database for the
|     session data and found that the session information was gone from
| the previous write. But
|     I am using an Innodb table and committing the transaction.  Odd?
|
|     I am calling the session_write_close function at the end of the
| transaction, to push the session through. Also,
|     in the session_destroy handler I put a debugging message to see if
| the session was being destroyed and that is
|     not the situation either.
|
|     Anybody have similar problems with delayed in session writing or
| lost session data? I register all of the data into
|     the session that I need leave the session alone except for reading
| of the session data. I'd say it has something to do with you transactions. Can you duplicate the errors using the same code on a system where the Innodb transactions do not require committing? Here is my own drop-in PHP session handling code if you care to compare notes: http://destiney.com/pub/php_db_sessions.tar.gz I've never had a problem with it and I am using it with Innodb tables on several projects currently. I've also heard the Pear DB Session stuff is pretty good too, but I've never tried it. - -- ******************************************************
*      __        __  _                               *
* ___/ /__ ___ / /_(_)__ ___ __ __ _______ __ _ * * / _ / -_)_-</ __/ / _ \/ -_) // // __/ _ \/ ' \ * * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ *
*                            (___/ greg@destiney.com *
****************************************************** BOFH Excuse #18: excess surge protection -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFADFxtoAq8t3CabwcRAsKBAKCIY8Xp8GxXjVpg+fY6uy84t0WRAgCdH/Ao mP6LQ6cy3qCuFeYLcS11exM= =mUJI -----END PGP SIGNATURE-----

« previous php.general (#175085) next »