php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12177 session_set_cookie_params broken
Submitted: 2001-07-15 10:48 UTC Modified: 2002-01-09 02:03 UTC
From: nick at macaw dot demon dot co dot uk Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.6 OS:
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: nick at macaw dot demon dot co dot uk
New email:
PHP Version: OS:

 

 [2001-07-15 10:48 UTC] nick at macaw dot demon dot co dot uk
This assumes default settings in php.ini

Description: the effect of session_set_cookie_params() is documented to last only for the duration of the calling script, however it's affect appears to last globally forever. i.e. After using a session named "SID1" with a cookie timout of 5 seconds, subsequently using a session "SID2" with default cookie parameters will also have a timeout of 5 seconds.

The following two scripts will illustate this.

<?php
  session_name("SID1");
  session_set_cookie_params(5,"/");
  session_start();
  echo "Sid is [",session_id(),"]\n";
?>

Loading this, SID1 changes every 5 seconds as expected.

Loading the following, however, SID2 also changes every 5 seconds, even though cookie params have *not* been set in this script.

<?php
  session_name("SID2");
  session_start();
  echo "Sid is [",session_id(),"]\n";
?>


Nick

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-19 22:13 UTC] yohgaki@php.net
Please test with 4.1.0 and latest CVS snapshot.
CVS snapshot can be found 
http://snaps.php.net/

If you don't have problem with latest CVS snapshot,
you can close your bug report by yourself.

Please report the result. When you update your bug
report, do not forget updating PHP version also.

Thank you
-- 
Yasuo
 [2002-01-09 02:03 UTC] lobbin@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC