php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20136 Sessions don't work across scripts
Submitted: 2002-10-28 10:13 UTC Modified: 2002-10-28 10:24 UTC
From: elloyd19 at yahoo dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.3 OS: Windows 2000 Pro
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: elloyd19 at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-10-28 10:13 UTC] elloyd19 at yahoo dot com
I'm using PHP running on Win2k using IIS and apache 1.3.x on separate machines.

The basic problem is that when you start a session using session_start() and register some variables using session_register(), you lose the session "link" when you jump to the other scripts/pages. 

If you check what PHP does, everything seems normal at first: it creates the session file and the vars are in there, with values and all.

The problem lies when you jump to the next page/script. Trying to get values using $_SESSION or $HTTP_SESSION_VARS produces no results. The values are still in the session file, but you can't get at them.

I don't think its my php.ini config that's causing this. Register_globals is on. And I've gone back to version 4.1.2 because sessions work on that, so I can't supply any config info.

Really sorry if this is a waste of your time in case you follow up on this and produces no results but I think there is a real problem here. I didn't find this in the advanced bug search either so I decided to post it here. There's also a lot of people stumbling about in the newsgroup this month wondering what's happening to their sessions.

Anyway, hope this helps.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-28 10:24 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Don't use session_register to register session variables, instead do $_SESSION['variable'] = 'value'; or $HTTP_SESSION_VARS['variable'] = 'value';

It would also be a very good idea to try the latest CVS snapshot, it contains many fixes to the session code, which were added since the 4.2.3 release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 10:01:28 2024 UTC