In your code, if $PHPSESSID is set then you'll need to invoke
session_start() anyway.
session_start() initializes all session variables to what they should be so
that you can access them.
Note: If someone submits the variable $name which is "Ted", and in their
session they have a variable called $name which equals "Bob", then the
following will end up weird:
$name1 = $name;
session_start();
$name2 = $name;
session_start declares all session variables as global, and it over-writes
any pre-existing variables of the same name.
--
Plutarck
Should be working on something...
...but forgot what it was.
""David Tandberg-Johansen"" <[EMAIL PROTECTED]> wrote in message
9aaumn$o69$[EMAIL PROTECTED]">news:9aaumn$o69$[EMAIL PROTECTED]...
> Hello!
>
> After confering with the this group earlier I got some hints on where to
> find som tutorials on sessions. But I am still confused about some things.
>
> Have I under stood it right:
>
>
> #session.php
>
> <?
> if (!$PHPSESSID) {
>
> session_start();
>
> #Then if some variables to register
> session_register(lang);
> session_register(name);
>
> setcookie (PHPSESSID, $PHPSESSID,time()+3600);
> setcookie (lang, $lang,time()+3600);
> setcookie (name, $name,time()+3600);
>
> } elseif ($PHPSESSID) {
>
> #I DON'T HAVE A CLUE TODO HERE, ANY HINTS?
>
> }
>
> ?>
>
> #END session.php
>
> And then I include the session.php in all the files I need to use session
> in?
> And I can get the variables from the cookie?
>
> David
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]