php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22054 Starting session from specified ID fails
Submitted: 2003-02-04 13:04 UTC Modified: 2003-02-13 02:18 UTC
From: tboardma at indiana dot edu Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.0 OS: Windows 2000
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: tboardma at indiana dot edu
New email:
PHP Version: OS:

 

 [2003-02-04 13:04 UTC] tboardma at indiana dot edu
I have a script that saves information to a session 
variable and then sends the session_id to another script 
via POST, which does something, then sends data to another 
PHP script by silent POST, including the session_id, which 
is to retrieve the original values saved in the session, 
specified by it's original session_id.

1st PHP script:
$USER_FORM = "a bunch of text";

session_register("USER_FORM");

$sess = session_id();

exit;


2nd PHP script:
/* We want to start our session from a session id that is 
passed
	to us in POST data */
$sess = $HTTP_POST_VARS['sess'};

ini_set("session.auto_start", "0");
ini_set("session.cache_limiter", "public");

session_id($sess);
session_start(); 

global $USER_FORM;

/* Instead of printint the "bunch of text", it prints 
nothing */
print $USER_FORM;


This same code worked using PHP 4.0.6 running on UNIX.


In my php.ini, I have session_auto_start set to true, which 
is why I turn it off by setting the ini in the 2nd script.
Register globals is on.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-04 13:55 UTC] tboardma at indiana dot edu
Running

SERVER_SOFTWARE 	Microsoft-IIS/5.0 
Server API 	ISAPI
 [2003-02-13 02:18 UTC] sniper@php.net
There's not much point in setting the session.auto_start
off in a script since at that time, the session is already
started.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 14:00:03 2025 UTC