how execlly is a session defined in php?
what i mean is : when i first access a php where i activate the session
and say after 2 minutes i close the browser and open a new one then it means that a new session is being created?
how execlly all of this thing work?
and what does it mean if i open aa chile window with window.open()
which session will it get?
thnaks i nadvance
peleg
session in php
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
sessions are a concept whereby the browser gets a unique identifier attached to it, either through URLs or through a cookie. When using a cookie, the expiration time for it is set to 0, or when the browser closes it's window. When using the url, if you don't return with the exactly correct id on the url you will get a new one. Some implementations will give you a new one based on several more criteria as well.
As for opening a child window, if done through url's, the session id quite possibly will be lost. This depends on the implementation however. With cookies, you will continue to be in the same session.
As for opening a child window, if done through url's, the session id quite possibly will be lost. This depends on the implementation however. With cookies, you will continue to be in the same session.
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
if so i dont understand what makes the browser save my cookie and nows its me?by the ip?
by a certain uniqe browser value or what?
and how execlly the server knows i have closed the vroswer - beacuse i can close it wighougt the server knows that it happens to restart the pc and get new ip for example
and in the same time some 1 else will get my ip for example and the server will think its me?????what make me unique that he knows its oly me and no one else?
by a certain uniqe browser value or what?
and how execlly the server knows i have closed the vroswer - beacuse i can close it wighougt the server knows that it happens to restart the pc and get new ip for example
and in the same time some 1 else will get my ip for example and the server will think its me?????what make me unique that he knows its oly me and no one else?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
the server generally doesn't care what ip you have. it generates the id on it's own using whatever unique id system implemented by the session manager you have. don't worry about that unless you are building your complete own session manager. Generally the id has nothing to do with your ip or agent string. It'll often hinge off the time, among some other things to make sure you get an entirely unique (for a good long time at least) value.
The browser gets a cookie with your domain, the session cookie name and value (the session id, usually). The server merely looks at the cookies sent in by your browser. If the session cookie isn't present, or is invalid, it creates a new id.
The browser gets a cookie with your domain, the session cookie name and value (the session id, usually). The server merely looks at the cookies sent in by your browser. If the session cookie isn't present, or is invalid, it creates a new id.
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
so actually what u say
is that the session id is stored in my browser ram and sent to the server
and like that th server know's who i am?
and like that th server know's who i am?