php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10604 couldnt update a session var or just register one
Submitted: 2001-05-02 05:53 UTC Modified: 2001-05-22 21:47 UTC
From: jose dot plans at wanadoo dot fr Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.4pl1 OS: linux (redhat 7.0)
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: jose dot plans at wanadoo dot fr
New email:
PHP Version: OS:

 

 [2001-05-02 05:53 UTC] jose dot plans at wanadoo dot fr
Hi and sorry to disturb but i have a pb 
and i dont know if is it a bug or something
else, hope is not a bug!

maybe the problem comes from the compilation,
maybe from me, but when i do :
-------------- SESSION PB -------------------
session_start();
$ID=session_id(); $WHAT=$pass.$ID;
if(!$SID){
   session_register("SID");
   $SID=md5($WHAT);
}else{
   $LOCAL_SID=md5($WHAT);
   if($SID!=$LOCAL_SID){
          session_destroy();
          ?><script>alert("ops...");</script><?
   }
}
----------------------------------------------
and i do :
echo session_encode();
i get :
----------------------------------------------
usr_pro|s:1:"1";usr_key|s:1:"1";connected|i:1;usr_log|s:3:"flo";!SID|secteur|s:1:"2"; 
with SID unset...

and other pb is that i cannot update a session var:
session_unregister('toto');
session_register('toto');

when this is done, i got the same values from toto.... :-(

thanks for all !
regards,

Jos? PLANS

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-22 21:47 UTC] sbergmann@php.net
> session_unregister('toto');
> session_register('toto');
> when this is done, i got the same values from toto

Sure, session_unregister() just 'removes' $toto from the session, it doesn't unset() it.

Your other code looks also weird to me. So, I'm closing this bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 12:01:32 2025 UTC