RE: [PHP] Session questions
| From: | Boget, Chris | Date: | Fri, 06 Oct 2000 16:49:01 +0000 |
| Subject: | RE: [PHP] Session questions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18938@lists.php.net to get a copy of this message | ||
> I'm having some problems with session and I'm
> hoping someone can help me. I am using php
> version 4.0.2.
>
> I am having PHP store the session information in
> a mysql database. The DB is called "sessions" and
> the sessions table looks like this:
>
> +---------+------------------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+------------------+------+-----+---------+-------+
> | sesskey | varchar(32) | | PRI | | |
> | expiry | int(11) unsigned | | | 0 | |
> | value | text | | | NULL | |
> +---------+------------------+------+-----+---------+-------+
>
> I have 2 pages. The first is starting a session and
> registering a variable. It is then pushing to the
> second page via header( "location" ). My questions
> and problems are:
>
> * When I register my variable, the "value" field stores
> the value I passed, but it now looks like this:
>
> !myvalue|
>
> why? Why is the session_register() adding the bang (!)
> and the pipe (|) at the beginning and the end of my
> variable?
>
> * From what I understand, I need to call the
> session_start() function at the top of every one of my
> pages in order to make sure all the session information
> is available to each page. This is correct, yes? If so,
> then why is it that every time I call that function, it
> creates a new session record in my DB with a totally
> new session id? How is any kind of continuity supposed
> to be kept from one page to the other if this is happening?
>
> There are a few others, but I need to run off to a meeting
> and the above are pretty much the major ones I need to
> resolve. It could very well be that if the above can be
> fixed, the minor issues will be as well.
> If anyone at all could help me, I would be so very appreciative.
> I've been around and around reading up as much as I could
> and I just cannot seem to figure out why the above is occuring.
>
> Thanks for your time in reading this far and for your
> help, if offered.
Can anyone offer any light to the above? One of my original
questions was answered this morning so I deleted it here.
Anyone?
Chris