|
Posted by Rik on 04/26/07 17:21
Jerry Stuckle wrote:
> Man-wai Chang wrote:
>>> No article I know of. But you will get two different session id's.
>>> You'll also get two session id's if the user uses two different
>>> browsers (i.e. IE and Firefox) from the same computer.
>>
>> Thanks. Guess I have to read the source codes of PHP to find it out
>> then ... :)
>>
>
> It has nothing to do with the source code for PHP. It's how browsers work.
>
> The browser keeps track of the session id, generally in a cookie (if
> cookies aren't supported PHP uses the GET parameters). Two different
> computers cannot share the same cookie - and therefore the same session id.
>
> It has nothing to do with ip addresses at all (which are not unique and
> may change at any time).
To elaborate:
When you 'start' a session, and the browser hasn't given the server a
session-id, a new session will be created, of which the server knows
it's not currently in use. Different browsers on a computer cannot check
each others session-id's (well, they could, but that's not implemented
and probably never will be simply because it's not usefull). So they get
different ones. This also means a browser which doensn't accept and/or
get a session-id will make the server start a new session on every request.
Simplest way to view it: a _program_ (normally browser) is communicating
with the server, not your computer, or your router, or your modem.
Allthough some ill-advised people often want to make it appear
(/implement) as such.
--
Rik Wasmus
Estimated date being able to walk again: 01-05-2007.
Less then a week, hurray!
Navigation:
[Reply to this message]
|