Jump to content

php sessions


gamernaveen

Recommended Posts

session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.

From the PHP manual: http://ca.php.net/manual/en/function.session-start.php

SID in a url is a way of passing a session id.
Link to comment
https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58906
Share on other sites

example i have two users in my site,
Now i have defined some vars abt their profiles.
Now if i dont use sid , both the visitors see the same profile.
If i use sid , each visitor views his own profile . Right?
Is it like that? am confused.!!!! ??? ??? ??? ??? :( :( :( ::) ::) ::)
Link to comment
https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58908
Share on other sites

A session is a way of keeping data between page requests.

You have 2 main parts to a session:
A session ID, and the data that corrosponds to that session id.

A user is given a session ID somehow (eg: a cookie, in the url, ext) and the server keeps track of what data corrposponds to that session id.

The data is kept server-side, and the only thing the user gets is the session id that corrosponds to the data.

When you see something like: "www.whatever.com/file.ext?sessionid=12345abc" It is a way of telling the server "hi, im mr.12345abc." The server can then acsees the stored information corrosponding to that session id, work with it, and output stuff to the user. Session ids are carried 3 ways: Get, Post, and Cookie. Get = in the URL, post = from a form, cookie = in a cookie.
Link to comment
https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58914
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.