Re: DATABASE SESSION vs NON DB SESSION
| From: | Todd Cary | Date: | Fri, 13 Oct 2000 22:23:41 +0000 |
| Subject: | Re: DATABASE SESSION vs NON DB SESSION | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20100@lists.php.net to get a copy of this message | ||
I am very new to PHP and I am in the process of tracking sessions.
Tentatively, I have chosen the DB route and I would like to clarify that
I am on the correct track.
When the surfer enters the Home page, I create a SessionID (time() ) and
I put this into a hidden field. When the user goes to the next page, I
again put the SessionID into a hidden field and I log the SessionID in
the DB along with an Expire time. All subsequent pages create a hidden
field containing the SessionID. Any information put in the database is
linked to the SessionID.
If I need to create a list of items belonging to the surfer, the table
contains the SessionID and an expire time. To make the list "permanent"
(e.g. confirms the order), I set the expire time to a high value (e.g.
1/1/2099).
This seems to work...am I missing anything? Won't this work with
multiple page server?
I use a cookie as a "convenience" only. For instance, I will try to set
a cookie with the SessionID so if the person returns at some other time,
I can get the surfers name without needing to have the surfer enter some
other value (e.g. phone number or e-mail address).
Todd
--
Todd Cary
Ariste Software
todd@aristesoftware.com