php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21282 don't work
Submitted: 2002-12-30 01:18 UTC Modified: 2002-12-30 09:40 UTC
From: advnik at mail dot ru Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.0 OS: WinXP Pro SP1
Private report: No CVE-ID: None
 [2002-12-30 01:18 UTC] advnik at mail dot ru
OS: WinXP Pro SP1.
Apache 2.
php 4.3 isap

index.php

    <?php
     session_start();
     session_register("sa");
     echo $sa."<br>";
     $sa=1;
     echo $sa."<br>";
     echo session_id()."<br>";
     echo session_name()."<br>";
     echo session_module_name()."<br>";
     echo session_is_registered("sa")."<br>";
     echo session_save_path()."<br>";  
    ?>
    <a href="http://localhost/index2.php">increment</a>

get 
 
    1
    728be1c2b387346bf08ec42680571589
    PHPSESSID
    files
    1
    C:\Program Files\php-4.3.0-Win32\sessiondata
    increment 

sess_728be1c2b387346bf08ec42680571589 is "sa|i:1;".

index2.php
    <?php
     session_start();
     session_register("sa");
     
     echo $sa."?<br>";
     $sa+=2;
     echo $sa."<br>";
     echo session_id()."<br>";
     echo session_name()."<br>";
     echo session_module_name()."<br>";
     echo session_is_registered("sa")."<br>";
     echo session_save_path()."<br>";  
    ?>
    <a href="http://localhost/index2.php">increment</a>

get
     ?
    2
    728be1c2b387346bf08ec42680571589
    PHPSESSID
    files
    1
    C:\Program Files\php-4.3.0-Win32\sessiondata
    increment 

sess_728be1c2b387346bf08ec42680571589 is "sa|i:1;".

sessiondata access is full.

Why?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-30 09:40 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

When you do: you already have 'sa' inside a session, registering it again is what causes the problem. It is also recomended that you use $_SESSION autoglobal to initialize session rather then session_register();
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 16:01:31 2024 UTC