ID:               14636
 Comment by:       anonymous at anonymous dot com
 Reported By:      kannan at tmsassociates dot com
 Status:           Bogus
 Bug Type:         Session related
 Operating System: windows 2000 professional
 PHP Version:      4.0.6
 New Comment:

Yes I have recently seen this phenomenon.
Note that I am purposely NOT saving session data in cookies.

session_start();
$_SESSION["foo"] = "bar";
header( "Location:foobar.php" );

On the remote Unix server running Apache I upload this to, it works
fine.  The session data is passed to foobar.php.
However on my local Windows machine, the session data is lost.  I end
up having to pass session data in the header myself.

header( "Location:foobar.php?" . Session_Name() . "=" . Session_ID()
);

It works but I'd rather not resort to that.


Previous Comments:
------------------------------------------------------------------------

[2004-05-23 21:02:41] lorenzob at interia dot pl

I'm working on PHP 4.2.3 with Apache 1.3.9 and I've got the problem
mentioned above. After logging in I do the simple

session_start()
$_SESSION['user'] = $_POST['login']

and as for that everythings fine. But when changing from test.php,
where above code is stored, into another page klient.php during the
same session the variable appears to be empty! In short, although the
variable is being registered fine it's not visible in other scripts,
what is an obvious denial of an idea of session variables.

Can anyone help? I've been fighting this one for over three days in
many ways but nothing seems to have an effect.

test.php:

     session_start();
     header("Cache-control: private");
     ob_end_flush();
     session_register("log");
     session_register("pas");
     $log = $_POST["login"];
     $pas = $_POST["pass"];

klient.php:

    session_start();
    header("Cache-control: private");
    ob_end_flush();

    $im = $log;
    $naz = $pas;
    echo "->".$im;

Big thanks in advance

------------------------------------------------------------------------

[2004-04-13 18:58:04] fvincentis at yahoo dot com

Had the same problem on IIS with the php cgi. The session_write_close()
did it for me! It didn't write the session variables before, but now
they are stored even if a header redirect follows.

------------------------------------------------------------------------

[2004-02-21 18:50:54] michael at graber dot org

Just found an annoying quirk (aka bug) in IE - after applying a
security patch, IE no longer sets cookies if the server or domain name
contain anything except alphanumerics (ie, no "_" or "-", etc.).

The symptom was that every page or refresh of the same page generated a
new session, and obviously no variables were passed from page to page.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;316112

------------------------------------------------------------------------

[2004-02-15 19:15:24] smcbride at msn dot com

I have had the same problem on Windows/IIS.  I thought it was a coding
mistake, but it turns out to be a problem with PHP / IIS.  When running
php as a cgi exe, it does not set up the session properly the first
time.  If you run it as an ISAPI extension, it works.  I spent a few
hours on this one.  If your symptoms are that the first time it does
not work and then hit the back button in the browser and try again and
it works, then it is probably this.  I read somewhere that this is
actually a IIS issue.

------------------------------------------------------------------------

[2004-01-29 06:53:31] brett dot crosby at australiswebtech dot com dot
au

Have experienced the same problem where an application works fine on
LAMP and not on Win2k. One thing that I did notice (by accident - I
turned on debugging to see what was happening) is that if I send some
output to the second page prior to the header() command the session
variable was registered. I'm then able to shut down the browser and
restart without problems. However, if I reboot my machine, I must send
the debug output again.
Note to self: Perhaps there is a way of sending some data to the
browser that will instantiate the session but clear the buffer before
sending the 'real' data?

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/14636

-- 
Edit this bug report at http://bugs.php.net/?id=14636&edit=1

Reply via email to