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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 12 06:01:32 2024 UTC