Re: [PHP4BETA] Still can´t get sessions to work
| From: | Stefan Lindmark - Sun Sweden - SE Manager | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: [PHP4BETA] Still can´t get sessions to work | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-12790@lists.php.net to get a copy of this message | ||
I have sessions working in RC1 and I think I haven't touched the
examples since beta 1. The way I'm using them is:
page.inc (inluded by all pages):
:
session_start();
:
login.php:
:
session_register("pss_user");
:
$pss_user = $user; // After verification
:
logout.php:
header("Location:");
session_destroy();
I'm not doing anything fancy at all, just registering a single user
name. But to my knowledge it does what I need, which is to retain a user
id no matter what pages the user browses until the browser is terminated
or user logs out.
§
"Gustafson, Mårten" wrote:
>
> Hello.
>
> Maybe I´m just stupid but I still don´t get anything registered in my
> sess_blah files.
>
> This code results in an empty session file:
> session_start();
> session_register('HTTP_SESSION_VARS');
> $HTTP_SESSION_VARS['username'] = 'marten';
>
> So does this code:
> session_start();
> $HTTP_SESSION_VARS['username'] = 'marten';
> session_register('HTTP_SESSION_VARS');
>
> And this code too:
> session_start();
> session_register($GLOBALS['HTTP_SESSION_VARS']);
> $HTTP_SESSION_VARS['username'] = 'marten';
>
> But with this code:
> session_start();
> $HTTP_SESSION_VARS['username'] = 'marten';
> session_register($GLOBALS['HTTP_SESSION_VARS']);
>
> I get this in may sess_blurkblah file:
> !marten|
>
> Any suggestions?
>
> thanks
> Mårten Gustafson
> marten@jerbro.se
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
--
Stefan Lindmark, M.Sc.C.Sc | Tel +46 (0)8 623 9182
SE Manager | Mobile +46 (0)70 623 9182
Sun Microsystems AB | Fax +46 (0)8 623 9005
Box 51, S-164 94 Kista, Sweden | E-mail
stefan.lindmark@sweden.sun.com