php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54412 problem session_id() with parameters
Submitted: 2011-03-28 18:44 UTC Modified: 2011-12-05 21:43 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cardi at thecsea dot it Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3SVN-2011-03-28 (SVN) OS: linux ubuntu
Private report: No CVE-ID: None
 [2011-03-28 18:44 UTC] cardi at thecsea dot it
Description:
------------
---
From manual page: http://www.php.net/function.session-id#Parameters
---
in documentation is written that session_id() with parameters must be written before session_start(), but in this method when i do session_start() id is changed. For fixed this bug I write session_id after session_start(9 and all run correctly.


Test script:
---------------
firtst method:
session_id(exaple_session_id)
session_start()

second method:
session_start()
session_id(exaple_session_id)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-01 14:20 UTC] tomas dot brastavicius at quantum dot lt
You are claiming that calling session_id(exaple_session_id) changed session ID, but this is exactly the purpose of this function. In normal cases, calling session_id(exaple_session_id) after session_start() is equivalent to not calling this function at all, since the session that ID is another than exaple_session_id has been already started.
 [2011-12-05 21:43 UTC] frozenfire@php.net
If you call session_id(), or any session function that has to change information 
in the headers, after you call session_start(), the change will not occur, and 
may cause unwanted behaviour, due to, say, the session ID stored server-side not 
being the one that was sent to the client.
 [2011-12-05 21:43 UTC] frozenfire@php.net
-Status: Open +Status: Bogus
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 01:00:01 2026 UTC