Can't fully destroy session. Help!

This is a discussion on Can't fully destroy session. Help! within the PHP General forums, part of the PHP Programming Forums category; I'm finishing an e-commerce site, but I've run into a problem destroying a session at the end ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-15-2003
threnode
 
Posts: n/a
Default Can't fully destroy session. Help!

I'm finishing an e-commerce site, but I've run into a problem destroying a
session at the end of a transaction.

The code I'm using, taken from a text book, is:

session_start();
session_unset();
session_destroy();
if( isset($HTTP_COOKIE_VARS[session_name()]) )
unset( $HTTP_COOKIE_VARS[session_name()] );

Now, I've tried updating this to:

session_start();
session_unset();
session_destroy();
if( isset($_COOKIE[session_name()]) )
unset( $_COOKIE[session_name()] );

but the problem is the same:
The problem is that when I go back to my homepage (using the same browser)
the shopping from the previous session is still in the cart.

I've tried placing phpinfo(); after the code above, and each time it tells
me that for HTTP_COOKIE, PHPSESSID=7cdb552e41b9ba6d293ffcead527530f (or
whatever my session was.)

ie. PHPSESSID still exists after the session has been destroyed using
session_destroy().

Is the PHPSESSID cookie the problem here? ie. the current session is being
destroyed, but when I use session_start() at the top of the next page, is
the previous session recalled using the PHPSESSID cookie?

I'd be very grateful if someone can offer a solution to this problem,
please. I've been trying to solve this for several hours and would
appreciate your help. Thanks in advance!


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0