This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > PHP Session end problems





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author PHP Session end problems
alwaysabitlost

2004-08-04, 7:15 pm

Hi guys

I've built a shopping cart, and at the end of the transaction, the completed
page is meant to destroy the cookie holiding the users session id and return
them to the front page with an empty basket and a nice new session.

Problem is while the cookie disappears fine, I can't seem to end the session
unless I close all the browser windows

I'm using the following code

<?php
setcookie ("mysite", "", time() - 3600);

session_start();
session_destroy();
session_unset();

if( isset($HTTP_COOKIE_VARS["mysite"]) )
unset( $HTTP_COOKIE_VARS["mysite"] );
?>

Anyone got any thoughts as to why it's not binning the session? Thanks.

alwaysabitlost

2004-08-04, 7:15 pm

Hmm, still no dice...

I can't figure it out.
Adenocard

2004-08-04, 7:15 pm

I remember running into this a while back.. something to do with
session_register() which has been deprecated. Take a look in the PHP manual
..chm edition notes.. I think it is there, and I will try to see if I can find
how I rectified this before.



alwaysabitlost

2004-08-04, 7:15 pm

Hi fellas

Cheers for the input, I finally got round it by deleting the cookie and
unsetting/destroying the session before going to the secure payment page which
did the business.

It's all gravy ;?)

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews