Forum Moderators: coopster

Message Too Old, No Replies

once a user has log in, how to keep record of it?

I am thinking to have a variable and passed it throught

         

digi_mind

7:33 am on Apr 7, 2003 (gmt 0)

10+ Year Member



I want a user to log into my page with user name and password, but after words I want to keep track of this users. I am thinking to let the user log in and save the name of he / she into a variable and passed it to each page the user is viewing, but it seem to be an other way of doing it. Something like this is what I want to do:

// Lets pretend the user has enter the user name, tehen I have this varible:

$user_name ;

I want to pass this user_name to the next page the user calls $_POST[user_name]; and keep on doing it. I know or belive their is an other solution.

Do you know how I could probably create a session in the serer side or something like that?

mavherick

7:40 am on Apr 7, 2003 (gmt 0)

10+ Year Member



I'm sure you'll find that section of the manual handy. Session [php.net]

Have fun.

mavherick

Filipe

1:48 am on Apr 8, 2003 (gmt 0)

10+ Year Member



"Session management", as what you're trying to do is called, is a big issue in the web world, and using SESSION variables, as maverhick pointed out, is probably the best way.

You might want to be careful about what data you actually record since there are users who get touchy about you recording what they do.

Here's a good rule of thumb to follow:
If you're recording user information, you should feel comfortable in putting exactly what you monitor in a "Privacy Policy" that's publicly available for users to read. Anything else is probably a violation of their privacy and might get you into trouble down the line.

gingerbreadman

4:12 am on Apr 8, 2003 (gmt 0)

10+ Year Member



It might even be worth making sure that they 'tick the box' to say they have read the privacy policy as they sign up for membership.