|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15513 Session Not Saved if header(Location... used
Submitted: 2002-02-11 19:20 UTC Modified: 2002-02-12 08:41 UTC
From: dante dot lorenso at atmosenergy dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.1.1 OS: Windows 98 and RedHat Linux 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dante dot lorenso at atmosenergy dot com
New email:
PHP Version: OS:


 [2002-02-11 19:20 UTC] dante dot lorenso at atmosenergy dot com
If I try to set or unset a session variable by
using the $_SESSION method of session handling,
before using a 'header("Location: /xyz");' redirect,
the session variable modification is not saved.

I've tried to use a 'flush()' a 'session_write_close()'
and 'exit;'...nothing seems to help.

class A {

    function A() {

    /* works */
    function foo() {
        $_SESSION["AUTH"] = "Dante";

    /* does NOT work */
    function bar() {
        $_SESSION["AUTH"] = "";
        // flush();
        // session_write_close();
        // exit;

    /* does NOT work */
    function bar2() {


/* file1.html
$a = new A();
$a->foo(); // works

/* file2.html
$a = new A();
$a->bar(); // fails

/* file3.html
$a = new A();
$a->bar2(); // fails


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-12 08:41 UTC] dante dot lorenso at atmosenergy dot com
Yeah, whatever.  I'm an idiot.  Everything is fine here.  Just ignore me.  --dante
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 16:05:57 2022 UTC