session handlers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

session handlers

Post 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)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

http://www.zend.com/zend/tut/session.php is a tutorial. Good idea would be to search these forums as well.
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Yeah, sorry. Forgot to search here. I'll be busy reading for the next half hour or so at least.
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post 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.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Could you post some code?
Post Reply