Re: How do sessions work exactly?
| From: | Jason Stechschulte | Date: | Fri, 28 Jul 2000 12:24:23 +0000 |
| Subject: | Re: How do sessions work exactly? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8767@lists.php.net to get a copy of this message | ||
All sessions do is give the user a unique id that
can be passed from page to page. It does not do
any authentication. You will have to do that
yourself. You could also look into phplib. I
can't recommend it though because I have never
used it myself. What I do is start the session
then check if there is a session variable $id. If
not, the user has not been authenticated, so I
send them to a login page where I can authenticate
them. After successfully logging in, I register
their username as a session variable.
Jason Stechschulte
jpstech@nc.edu
-----Original Message-----
From: generic@x.duh [mailto:generic@x.duh]On
Behalf Of Generic Player
Sent: Friday, July 28, 2000 4:07 AM
To: php-general@lists.php.net
Subject: [PHP] How do sessions work exactly?
I am way lost on sessions. What I am trying to do
is have a cookie
identify a message board poster. But to prevent
people from being able
to make their own cookies with someone else's
identity contained,
I don't want to use a plain old cookie to store
their identity. If I
understand corectly, a session would send a cookie
that contains a
unique ID string, and that ID string would the be
associated with the
variables stored on my server. Is this correct?
Assuming that's how its supposed to work, how do I
make it work like
that? The persons identity will already be stored
in a mysql database,
can I have the session point to the database
itself? What I am doing so
far is just using session_register($name, $blarg)
in the registering
script. So if they register blarg is set to 1,
and stored with the name
they used as the session. Then, in theory I
should be able to call
those variables in other pages used to actually
post messages right?
What exactly do I need to do to be able to access
them from the other
pages? All I have is session_start() at the
beggining of the other
pages, and that's not working.
Thanks for any help
Generic Player