I am trying to implement session management into our site. I have a shopping cart that requires a unique session id (used as the index into the shopping cart) for each user.
In index.php i have
session_start();
//change session name to be used part of the cookie name/value
$session.session_name('quan@twoguysco.org');
i then take the session_name and the Session_ID and create a new record in the shopping cart table.
The problem is when i go to shoppingcart.php from index.php, i try to access session_id() but it would not let me. It returns blank.
I would like to associate the person visiting shopping cart with his/her session. How can i get the session id for the user so i can pull his record from the database.
thanks a million for your help.
--quan
problems with session in multiple screens
Moderator: General Moderators
-
PingLeeQuan
- Forum Commoner
- Posts: 58
- Joined: Tue Sep 03, 2002 8:08 am
read http://www.php.net/manual/en/function.session-name.php
esp. note
esp. note
Thus, you need to call session_name() for every request (and before session_start() or session_register() are called).
-
bionicdonkey
- Forum Contributor
- Posts: 132
- Joined: Fri Jan 31, 2003 2:28 am
- Location: Sydney, Australia
- Contact:
-
PingLeeQuan
- Forum Commoner
- Posts: 58
- Joined: Tue Sep 03, 2002 8:08 am