php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11068 cookie lost after redirect header(Location:);
Submitted: 2001-05-23 18:23 UTC Modified: 2001-05-23 19:19 UTC
From: mike at kristopeit dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.5 OS: win98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
8 - 4 = ?
Subscribe to this entry?

 
 [2001-05-23 18:23 UTC] mike at kristopeit dot com
take these 3 scripts: 

include.php 
======================== 
$value = 1; 
$boolean = $session[0]; 
if($boolean) $value = 0; 
======================== 

script1.php 
======================== 
include("include.php"); 
setcookie("session[0]","1",0,"/","",0); 
header("Location: /script2.php"); 
======================== 

script2.php 
======================== 
include("include.php"); 
echo $value; 
======================== 


now here is the problem... i run script one, it includes "include.php" and sets the cookie and redirects to "script2.php", but i don't think script2.php is including "include.php" again after the cookie set. these aren't the real scripts i am testing this on, but something very similar. is there a problem with this sequence: 

script1: 
>include("file"); 
>header("Location: script2"); 
script2: 
>include("file"); 

thanks 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 18:51 UTC] sniper@php.net
Ask support questions on php-general@lists.php.net


 [2001-05-23 19:19 UTC] mike at kristopeit dot com
this isn't a support question, it is a demonstration of a repeatable bug!
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 05:01:26 2019 UTC