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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.