Re: Silly sessions problem.

From: Date: Thu, 22 Mar 2001 22:02:44 +0000
Subject: Re: Silly sessions problem.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45217@lists.php.net to get a copy of this message
other way around, set the variable the register it session_start(); $hello = 'chris lee'; session_register('hello'); here is my session file. <?php include_once('time.egn'); if ( isset($PHPSESSID) ) session_id($PHPSESSID); session_start(); if (!isset($HTTP_SESSION_VARS['SessionID'])) { $SessionID = mtime(); session_register('SessionID'); } $PHPSESSID = session_id(); $SID = "PHPSESSID=$PHPSESSID"; ?> -- Chris Lee lee@mediawaveonline.com ""Lic. Rodolfo Gonzalez Gonzalez"" <rodolfo@equinoxe.g-networks.net> wrote in message news:Pine.LNX.4.30.0103221729310.10789-100000@equinoxe.g-networks.net... Hello list, I just can't make sessions work. This is driving me mad, I'm sure it's something silly, but maybe my headache made me a fool :P :) ... could you please tell me what's wrong here?. hello.php has a link to next.php: --- start of hello.php --- <?php session_start(); session_register("hello"); $hello = "Hello World!"; ?> <html> <head><title></title></head> <body> <?php print "<a href=\"next.php\">$hello</a>"; ?> </body> </hmtl> --- end of hello.php --- -- start of next.php <?php // following the manual, I need to call session_start to resume the // session I started at hello.php (?) session_start(); ?> <html> <head><title></title></head> <body> <?php print "Hello is set to: $HTTP_SESSION_VARS[hello] - $hello"; ?> </body> </html> --- end of next.php --- Now I click on the hyperlink and get a new cookie (produced by call to session_start() in next.php). Using PHP4.0.4pl1 (with --enable-trans-id), Apache, and the linux version of ns navigator as browser. Thank you!, Rodolfo. -- 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

« previous php.general (#45217) next »