Unable to access the assigned session variable

From: Date: Mon, 21 Oct 2002 18:10:41 +0000
Subject: Unable to access the assigned session variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120780@lists.php.net to get a copy of this message
Hi : I am new to Php, i am having some problem with session in PHP I am not sure what went wrong, I am using php4.2.3 when i try to set session with following code <?php $os="BSD"; session_register($os); $name="devon"; $devon="my Name"; session_register($name); ?> <?php session_start(); $user="dodell"; if(session_register("user")){ echo("User Field set to $user."); } else{ echo("Coud not set the session variable"); } ?> it works well and it write the session value into session file ************ user|s:6:"dodell"; **************** but when i try to access the same session variable (used the following code) <?php session_start(); echo("Welcome to the user area , $user"); ?> I am getting some error message ******************************** Notice: Undefined variable: user in c:\projects\test\session2.php on line 3 Welcome to the user area , ****************************** Can any one please specify what went wrong with my code Or should i need to make any chages in my php.ini files etc.. when i run phpinfo(); it out put shows that Session support enabled Thanks in advance Prad __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/

« previous php.general (#120780) next »