php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25387 session_start() always creates new session
Submitted: 2003-09-03 16:38 UTC Modified: 2003-09-03 16:58 UTC
From: alex at rapidfans dot at Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.3 OS: windows xp
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: alex at rapidfans dot at
New email:
PHP Version: OS:

 

 [2003-09-03 16:38 UTC] alex at rapidfans dot at
Description:
------------
im using php 4.3.3, system xp, apache 1.3

globals off, 

first page:

session_start();
$_SESSION["test"] = "ok";

second page:

session_start();
echo($_SESSION["test"]);

but on the second page, the session is created new.
(my browser accepts cookies)
whats wrong?



Reproduce code:
---------------
session_start();
$_SESSION["test"] = "ok";

session_start();
echo($_SESSION["test"]);

Actual result:
--------------
nothing in session

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-03 16:58 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

..

 [2004-04-27 07:25 UTC] phpfrost at frost-web dot de
I reconsturuated the problem with the Session_id.
I found out that "session_start" generates a new session_id every time, if the session.cookie_path-parameter in the php.ini is not set up right.

Look at your php.ini-File. If the session_cookie_path-parameter is set up to session.cookie_path = / , all things are right. If there is another value than '/', this could be the reason for the problem.

Mathias
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 09:01:33 2025 UTC