Page 1 of 1

session destroy and unset

Posted: Mon May 24, 2004 2:55 pm
by loongest
<?php

session_name();
session_start("customerid");
session_start("firstname");
session_start("lastname");

if(!(session_is_registered("customerid")))
{
session_unset();
session_destroy();

session_start("guest");
$guest = "Guest";
session_register("guest");

}

how can i destroy the session only for the guest ? but not customerid ?
or once the session_unset() and session_destroy() is call all the session variable will lost?

Posted: Mon May 24, 2004 3:05 pm
by feyd
well.. if you took the time to look at the manual for session_start() you'd notice that it doesn't take any arguments.

the bible

Posted: Mon May 24, 2004 3:09 pm
by loongest
but the session_start("customerid") that i follow from the book....
it's take arguments

Posted: Mon May 24, 2004 3:40 pm
by John Cartwright
There is no point to it at all.. session_start() starts the session

if you want to get rid of a specific session var than do this

$_SESSION["foobar"] = array();