Page 1 of 1

session handlers

Posted: Tue Jun 08, 2004 1:45 pm
by Unipus
I've been having this fairly constant problem that affects a limited number of users, where session variables just get dumped without any apparent cause. PHP docs assured me this was a bug fixed in 4.3.2. Well, it's not fixed. So now I absolutely have to fix the problem; seems the best way to do that is to write a custom session handler. If anyone has any resources on writing a session handler (since I've never done that), I'd appreciate seeing them here.

In case you're wondering, this is the bug: http://bugs.php.net/bug.php?id=20449 (and I can't say I'm too pleased with the dev team's handling of it)

Posted: Tue Jun 08, 2004 2:10 pm
by patrikG
http://www.zend.com/zend/tut/session.php is a tutorial. Good idea would be to search these forums as well.

Posted: Tue Jun 08, 2004 2:57 pm
by Unipus
Yeah, sorry. Forgot to search here. I'll be busy reading for the next half hour or so at least.

Posted: Tue Jun 08, 2004 5:39 pm
by Unipus
Well I've implemented a session handler that has some serious problems so far, but I'm slowly getting through them. However, one that I simply can't figure out for the life of me is that Mozilla will now no longer open the shoppingcart page (which has always existed).

I'm testing locally, and all pages use relative links. So the address to the shopping cart is 10.1.1.36/shoppingcart.php. The file is there. IE can open it. Firefox, however, throws up an alert saying "The file /shoppingcart.php cannot be found. Check the location and try again." Note that it throws this up as an application error; it doesn't even go to the 404 page. Weird.

I know this has something to do with the session handler I've implemented, because I was testing just fine with Firefox up until earlier this afternoon. Could the server name somehow have gotten cropped out? I notice that the link points to http://10.1.1.36/shoppingcart.php but the alert makes no mention of the server address, just the URI. That's the only idea I have, and no clue about why it might have happened or where to fix it.

Posted: Wed Jun 09, 2004 2:53 am
by patrikG
Could you post some code?