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
loongest
Forum Commoner
Posts: 25 Joined: Wed Apr 07, 2004 12:23 pm
Post
by loongest » Mon May 24, 2004 2:55 pm
<?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?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon May 24, 2004 3:05 pm
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
loongest
Forum Commoner
Posts: 25 Joined: Wed Apr 07, 2004 12:23 pm
Post
by loongest » Mon May 24, 2004 3:09 pm
but the session_start("customerid") that i follow from the book....
it's take arguments
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Mon May 24, 2004 3:40 pm
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();