• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

need help with sessions!

harrylmh

New Member
Help!

I used:
PHP:
session_start();
session_register("user");
$HTTP_SESSION_VARS["user"] = "jane";


Next page that checks it's valid:
PHP:
if (!isset($HTTP_SESSION_VARS["user"]))
    //but the variable is always not set!

I checked the session file but it only has this in it:
!user|

no value


I checked the PHP site (http://php.ca/manual/en/function.session-register.php) and it said:
"If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister(). "
What does it mean?

Could anyone please tell me why can't I give the session variable any value?

I appreciate any help.
Thank you
 
session_start();
session_register("user");
$HTTP_SESSION_VARS["user"] = "jane";
I checked the session file but it only has this in it:
!user|
I checked, that file contains (PHP 4.3.0-dev):
user|s:4:"jane";
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister(). "
What does it mean?
session_start();
$HTTP_SESSION_VARS["user"] = "jane";
is enough .
yes, I did execute session_start() on the second page.
Dont execute session_start() on the second page, it makes a new session as I know .
 
Back
Top