Page 1 of 1

Session not working when it was before

Posted: Sat May 29, 2004 1:53 am
by anjanesh
I was using WinMe and installed Win 2003 Server Ent but I couldn't get MySQL to work in 2003 however much I try, so I reinstalled Me.
Now I'm not getting sessions to work though it was working fine before.
I changed the session.save_handler = user in the php.ini file in c:\windows.
session.name is $PHPSESSID
This code does not print the session id though it did before.

Code: Select all

<?php
session_module_name("user");
session_set_save_handler("session_open","session_close","session_read","session_write","session_remove","session_gc");
session_start();
print($PHPSESSID);
function session_open($path,$name)
 {
   return true;
 }
function session_close()
 {
   return true;
 }
function session_read($id)
 {
      return true;
 }
function session_write($id,$data)
 {
    return true;
 }
function session_remove($id)
 {
    return true;
 }
function session_gc($life)
 {
    return true;
 }
?>
Please help.
Thanks

Posted: Sat May 29, 2004 4:38 am
by feyd
register_globals may be off, which would make print_r($PHPSESSID) cause a warning.. try print_r($_COOKIE) instead.

Posted: Sat May 29, 2004 5:17 am
by anjanesh
I set register_globals = On
Even then print($PHPSESSID); does not print anything. However print($_COOKIE); prints Array

Posted: Sat May 29, 2004 5:47 am
by anjanesh
I need to know if its a problem with IE5.5 ? I checked up at google and found no relevant pages. Will sessions work fine in IE5.5 ?

Posted: Sat May 29, 2004 6:51 am
by itsmani1
Why don't you use IE6.0?????

Posted: Sat May 29, 2004 8:01 am
by anjanesh
Guess what ?

Code: Select all

<?php
session_module_name("user");
session_set_save_handler("session_open","session_close","session_read","session_write","session_remove","session_gc");
session_start();

print(session_name());
print('<BR>');
print(session_id());
print('<BR>');
print($PHPSESSID);
.
<session functions>
.
.
.
?>
is printing

PHPSESSID
6ae13db518d58c56b3a54c3a889d61c7



though it should have been

PHPSESSID
6ae13db518d58c56b3a54c3a889d61c7
6ae13db518d58c56b3a54c3a889d61c7


Can anyone explain why ? Before it wasn't like this.

Thanks a lot.