Session Varaible Problem

From: Date: Thu, 21 Mar 2002 17:22:00 +0000
Subject: Session Varaible Problem
Groups: php.general 
Request: Send a blank email to php-general+get-89552@lists.php.net to get a copy of this message
Hi, I have tried every example of creating a session variable I could find on php.net and have had the same results with all of them. The session variables get set on the initial page but that's the only place I can access them. I am new to php so I'm sure I have just overlooked something. Here is my latest attempt. It's a simple login page that starts a session when a user successfully logs in: $connect... $sql ... list($id,$first_name) = mysql_fetch_row($sql); session_start(); if (!session_is_registered('user_id')) { session_register('user_id'); $user_id = $id; session_register('user_name'); $user_name = $first_name; } else { echo "<p>Session is set and should now be availalbe on all pages via a cookie. At least that what I expected."; } Sadly, these vars are available only on this page. echo "<p>ID: $user_id"; echo "<p>Name: $user_name"; Mac OSX Apache PHP 4+ Thanks, -- Rp

« previous php.general (#89552) next »