Re: Going backwards with sessions.

From: Date: Wed, 14 Feb 2001 00:44:02 +0000
Subject: Re: Going backwards with sessions.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39545@lists.php.net to get a copy of this message
Basically I'm trying to get 3 session vars on a page in a sub directory, clientid, clientname and rnum. I do a session_start() at the beginning of every page, I also do a session_id($HTTP_COOKIE_VARS['sessId']) on each page, with the sessid being the same. But when I do "echo session_id()" on the second page after setting it and starting the session, it comes back blank, as thought the session was being destroyed or just not starting. I've tried registering the variable on the second page, and it still doesn't work At 2/13/2001 04:20 PM, you wrote:
mine is alot simpler and works fine, try this. <?php
        session_start();
        if (!isset($HTTP_SESSION_VARS['SessionID']))
        {
                $SessionID = mtime();
                session_register('SessionID');
        }
?> -- Chris Lee Mediawaveonline.com em. lee@mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Doug Budny" <dbudny@diligence.com> wrote in message news:5.0.0.25.2.20010212111352.00a91e48@mail.diligence.com... I'm having a strange problem with sessions, it appears that they are not propagating to the next page. When I run the login page the sess vars get registered, the session_id() get's set, and the cookie sessId get's set. However when I go to the order page in a subdirectory only the cookie sessId comes over correctly. It will not set the session_id(). The only thing that prints as expected is the cookie var and $sessionId. I'm using 4.0.4pl1 on Redhad 6.2 apache 1.3.9 . enable_track_vars is enabled and so is register_globals. Am I doing something wrong or is Sessions broken in pl1? <?php // login page srand((double)microtime()*1000000); $sessionId = md5(uniqid(rand())); session_id($sessionId); session_start(); setcookie("sessId", $sessionId); session_register('clientid'); session_register('clientname'); session_register('rnum'); ?> <?php // order page $sessionId = $HTTP_COOKIE_VARS['sessId']; session_id($sesssionId); session_start(); //global $clientname; //global $clientid; echo ('<br>Client ID :' . $clientid); echo ('<br>Rnumber :' . $rnum); echo ('<br>SessCli Name :' . $HTTP_SESSION_VARS['clientname']); echo ('<br>Session_Id() :' . session_id()); echo ('<br>Session_name() :' . session_name()); echo ('<br>sessId :' . $HTTP_COOKIE_VARS['sessId']); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
---- Atheism is a non-prophet organization.

« previous php.general (#39545) next »