Sessions question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey all, i'm new to this list so forgive me if  i make any huge
mistakes.
I'm in a beginning stage of learning php and i hope you guys can help me
out with this question:

in a file named checkuser i do this when a users logs in:
PHP Code
// Register some session variables!
        session_register('userid');
        $_SESSION['userid'] = $userid;
        session_register('first_name');
        $_SESSION['first_name'] = $first_name;
        session_register('last_name');
        $_SESSION['last_name'] = $last_name;
        session_register('email_address');
        $_SESSION['email_address'] = $email_address;
        session_register('user_level');
        $_SESSION['user_level'] = $user_level;



Now let's say user 1 logs in, his session is registered (with userid
from database is 5 and first_name is XXX)
Then another user logs in, again his session is registered (with userid
from database is 1 and first_name is YYY)

Now user 1 leaves the pages (closes the browser) and user 2 uploads a
document (with my own script).

When the document is succesfully uploaded i display this:
PHP Code
echo ($_SESSION['first_name']).", the document has been succesfully
added";
echo ($_SESSION['userid']);



This results in the folowing output:
YYY, the document has been succesfully added
5

Meaning the $_SESSION['first_name'] is correct, but the
$_SESSION['userid'] is the one of the user who logged out...

Now when using user_id in all places it seems to work correctly...

Is userid something that is defined by the server when making sessions?

If not, i don't have any clue what is going wrong...
Can someone help me on this? So i know what is wrong?

Thx in advance

Reinhart Viane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux