Jump to content

Archived

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

gamernaveen

php sessions

Recommended Posts

Please someone help me.
i dont know y ppl use SID in url while they can retrieve with session_start().
Can some one tell me? 8) ??? ??? ??? ??? ??? ??? ;)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.!!!! ??? ??? ??? ??? :( :( :( ::) ::) ::)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.