Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass user info to diffrent pages using sessions?

Status
Not open for further replies.

keith23

Technical User
May 26, 2005
97
NL
Hi all i wonder how i can pass user information such as login name to diffrent pages using sessions. My intention is that i want in diffrent pages the php pages automatically knows who is using the page and where user log name is necessary it is avaliable by just doing echo $username or using $username in queries.Furthermore, i want the sessions some how expire within 15 min or so.I be happy if an expert show me how i can create sessions and how to use it in php pages for above purpuse. Thanks
 
sessions are a big subject. read up on them in and also in the FAQ section:
broadly:
1. use session_start() at the top of every page
2. store things in the session by using $_SESSION['elementname'] = 'element value'
3. delete session elements by using unset($_SESSION['elementname'])
4. destroy sessions altogether by going unset ($_SESSION); session_destroy();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top