php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23486 Session expires on redirection
Submitted: 2003-05-05 01:23 UTC Modified: 2003-05-05 01:34 UTC
From: bangboy2k2 at hotmail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.2RC1 OS: Windows 2000 Advanced Server
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bangboy2k2 at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-05-05 01:23 UTC] bangboy2k2 at hotmail dot com
Hi there,

i have been working with ASP/JSP for quite sometime. now getting into PHP. i'm facing too many problems related to sessions.

I have a page in which after validating username and password i'm placing the username in session and redirecting to a page. in the next page session expires unconditionally. i am starting sessions explicitly and using ob_start() for optimized redirects...

where as if i write some text to the response stream and then try to access the same page... session works very fine. Is there any solution to over come this? i'm placing the code snippets below to analyze.

	$row = mysql_fetch_array($result, MYSQL_BOTH);

	$_SESSION["uid"] = $row[0];
	$_SESSION["uname"] = $row[1];

       header("Location: bohome.php");

      session fails in bohome.php (note i am starting session even in bohome.php).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-05 01:34 UTC] magnus@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

It works just fine if you do it correctly. 
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 01:00:01 2026 UTC