Re: NT 4.0.6 session weirdness

From: Date: Wed, 17 Oct 2001 22:40:32 +0000
Subject: Re: NT 4.0.6 session weirdness
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-71418@lists.php.net to get a copy of this message
I haven't actually tried this yet, but even if it works, there's still a bug; the windows build is --enable-trans-sid and the browsers have cookies enabled and it even has worked on occasion once or twice -- I'm ok if I find a bug that's my fault; but this just seems flaky and only on NT -- it all works fine under *nix. I do see some of the other things you've changed, though honestly my conept code was just that in the message, I do a few of the other things already -- though I draw the line at the $SERVER_NAME thing -- if relative urls stop working for redirects I've got thousands of lines of code on dozens of sites to go fix;) On Wed, Oct 17, 2001 at 03:43:56PM -0700, Chris Lee wrote: > Try this. > > Page 1: > <?php > session_start(); > $PHPSESSID = session_id(); > $SID = "PHPSESSID=$PHPSESSID"; > > $userid = 'valid'; > session_register('userid'); > > header("Location: > http://$SERVER_NAME/protectedpage.php?$SID"); > exit(); > ?> > > Page 2: (protectedpage.php); > <?php > session_start(); > $PHPSESSID = session_id(); > $SID = "PHPSESSID=$PHPSESSID"; > > if( !isset($HTTP_SESSION_VARS['userid']) ) > { > $msg = urlencode('Must Login!'); > > header("Location: > http://$SERVER_NAME/loginpage.php?msg=$msg&$SID"); > exit(); > } > ?> > > -- > > Chris Lee > lee@mediawaveonline.com > > > > "Hank Marquardt" <hmarq@yerpso.net> wrote in message > news:20011017153342.A45549@hermes.yerpso.net... > > Of course I didn't state the problem ... > > > > The $userid session variable isn't passed, is 'unset' and thus always > fails to authenticate the protected page, bouncing to login. > > > > On Wed, Oct 17, 2001 at 04:21:07PM -0500, Hank Marquardt wrote: > > > I saw someone else with this problem and no answer, yet I saw sniper > blow away as "Bogus" when reported as a bug(13687) -- > > > > > > Warning -- I don't do much NT work so a configuration problem could be, > but session propogation seems flaky on 4.0.6 CGI NT -- > > > > > > The particulars are like this: > > > > > > Page 1: > > > <?php > > > session_start(); > > > session_register("userid"); > > > $userid="valid"; > > > header("location:protectedpage.php"); > > > exit(); > > > ?> > > > > > > Page 2: (protectedpage.php); > > > <?php > > > session_start(); > > > session_register("userid"); > > > if(!isset($userid)) { > > > $msg=urlencode("Must Login!"); > > > header("location:loginpage.php?msg=$msg"); > > > exit(); > > > } > > > ?> > > > > > > Most of the time this just plain doesn't work -- even though it works on > every *nix box I have (various flavors of Linux and BSD) -- > > > > > > Anyone else seeing this? ... BTW, as simple session test works fine: > > > > > > <?php > > > session_start(); > > > session_register("count"); > > > echo "You've visited ".$count++."times!<br>"; > > > ?> > > > > > > That will keep incrementing and displaying a counter on refresh, it > seems to be the page transfer/header stuff that's fubared. > > > > > > Any thoughts? > > > > > > -- > > > 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 > > > > -- > > Hank Marquardt <hank@yerpso.net> > > http://web.yerpso.net > > > > Web & Database Development in PHP, MySQL/PostgreSQL > > Small Office Networking Solutions - Debian GNU/Linux & FreeBSD > > PHP Instructor - International Webmasters Assn./HTML Writers Guild > > *** Beginning PHP -- Starts November 5, 2001 > > *** See http://www.hwg.org/services/classes > > > > > > -- > 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 -- Hank Marquardt <hank@yerpso.net> http://web.yerpso.net Web & Database Development in PHP, MySQL/PostgreSQL Small Office Networking Solutions - Debian GNU/Linux & FreeBSD PHP Instructor - International Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts November 5, 2001 *** See http://www.hwg.org/services/classes

« previous php.general (#71418) next »