Re: How to create, name and start PHP sessions

From: Date: Thu, 18 Apr 2002 10:48:24 +0000
Subject: Re: How to create, name and start PHP sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-93505@lists.php.net to get a copy of this message
session_name will retur the previos name of the session, so in your case $stuff will contain "PHPSESSID" and i think you have to call session_start(); before you do $HTTP_SESSION_VARS["username"] = $username; so perhaps this will work: session_name("hasLoggedIn"); $stuff = session_name(); session_start(); $HTTP_SESSION_VARS["username"] = $username; Regards, Michael "Phil Powell" <soazine@erols.com> schrieb im Newsbeitrag news:20020418094249.30058.qmail@pb1.pair.com... > Will the following lines set up a session by the name of "hasLoggedIn" with > HTTP_SESSION_VARS["username"]? > > $stuff = session_name("hasLoggedIn"); > $HTTP_SESSION_VARS["username"] = $username; > session_start(); > > I am trying to create a page that sets a session variable upon successful > login, problem is, the session_name() never changes it always remains the > default PHPSESSID what am I doing wrong now? > > I fixed the problem with multiple files, that was bizarre! > > Thanx > Phil > >

« previous php.general (#93505) next »