Jump to content

Destroy One Session, But Keep Other One


son

Recommended Posts

I use sessions for a shopping cart and for a dedicated user area on same website. On logout page of dedicated user area I have:

$_SESSION = array(); // destroy the variables	session_destroy(); // destroy the session itself	setcookie (session_name(), '', time()-300, '/', '', 0); // destroy the cookie

As this destroys all session data this is not what I want. I want only to destroy the session data relevant to dedicated user area. I use $_SESSION['first_name'] for login/logout status of user area and $_SESSION['cart'] for shopping basket. How do I only destroy first_name?Son

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...