SQL session handler problem
| From: | Trond Arve Nordheim | Date: | Fri, 03 May 2002 23:10:14 +0000 |
| Subject: | SQL session handler problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-95992@lists.php.net to get a copy of this message | ||
Hi!
I just wrote a SQL session handler class using some info from the
example at
http://gateway.digitaria.com/~chris/php/mysql_session_handler/.
And.. everything works perfectly, until I attempt to set a session
variable, and the custom write function get's executed. It seems that
the data parameter passed to the function is empty, no matter what I do.
The session-id parameter is correct (and users keep their sessions,
it seems like things are working except this), but the data parameter is
empty.
I read in the example on the URL above that if you didn't set
session.save_handler to user, something would go bad during write.
The session class can be found at
http://www.nordheim.no/temp/session.class.phps
(no use to paste the
whole thing here I guess). Never mind those funny database-class-things
in there, it's just a PEAR DB-wrapper (imagine that, a wrapper-wrapper ;).
I'm initiating the class like this;
$session = new Session(); /* Constructor will set session.save_handler */
$session->setHandler(); /* This will define session handlers */
$session->Start(); /* Executes session_start(). Is that enough? Works
with the default session handler ;) */
..then, I set a session variable:
$_SESSION["test"] = "TESTING";
then, the $session->_write() functions gets executed, but the data
parameter is blank.
Can anyone tell me what I'm doing wrong here?
I'm running PHP 4.2.0 on Apache 1.3.24 (Linux).
--
Trond Arve Nordheim
- "This message is ROT13-encrypted twice for extra security."