problem with session storage in db
| From: | Patrik Wallstrom | Date: | Tue, 24 Oct 2000 14:39:42 +0000 |
| Subject: | problem with session storage in db | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-3875@lists.php.net to get a copy of this message | ||
Hi,
We're using MySQL 3.23 with the latest versions of PHP.
When changing the content of a session variable, PHP is not fast enough in
storing that data in the db until the browser loads the next page (for
example when redirecting the browser with Location:) that the next page
contains that data.
Is there any solutions for this? I understand that this does not happen if
you use a local file storage for this, but using an external db, this is a
problem. The reason for using an external db is for building a really
scalale web site with sessions being used on a load balancing cluster.
The easy solution would be to lock the table for each write to the session
table, but this would really slow things down. Not usable in this context.
One can make PHP sleep for a second before redirecting the browser as
well, but this does not guarantee that the data has been written yet
either.
--
patrik wallstrom | f o o d f i g h t
tel: +46-8-6188428 | s t o c k h o l m
gsm: +46-708405080 | - - - - - - - - -
fax: +46-859827151 |