|
Posted by Richard Schneidt on 01/04/07 23:56
Jeff schrieb:
> php version 5.2.0
>
> From http://no.php.net/session I've read that a session is either stored in
> a cookie on the user side or is propagated in the URL.
Can you post the ecact line you refer to?
Did you read:
"A visitor accessing your web site is assigned a unique id, the
so-called session id. This is either stored in a cookie on the user side
or is propagated in the URL.
"
Then you didn't read closely, it only mentions a session id, that is
either send along in the url, e.g.:
index.php?PHPSESSID=5902345klwrletweltwktl
or in case the browser accepts cookies you will find the PHPSESSID
inside a cookie on your client computer.
>
> So if the session below (see code example below) isn't propagated in the URL
> then it's stored in a cookie?
You have to differentiate, betweeen a session a session_id and session data.
>
> And also I'm wondering about how can I set the expire time of this cookie?.
> I mean I didn't use setcookie to create this cookie...
you cannot set the expiretime for something you don't have:-)
>
> <?php
> session_start();
you start a new session that is stored on the server the server assigns
a unique id (PHPSESSID) to it.
> $_SESSION['count'] = 3;
now you store a key value pair in the session.
Now to access this data, the client needs to tell the server his session
id, in case the browser accepted the session cookie, it will just send
it along, in case his browser does not accept cookies he has to submit
the id in the url, which will only be done if the php designer added the
PHPSESSID=452n54k23n54k23 to the url.
> ?>
>
> Sorry I'm just a newbie
>
> Jeff
>
>
Navigation:
[Reply to this message]
|