gamernaveen Posted July 16, 2006 Share Posted July 16, 2006 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) ??? ??? ??? ??? ??? ??? ;) Quote Link to comment https://forums.phpfreaks.com/topic/14760-php-sessions/ Share on other sites More sharing options...
Joe Haley Posted July 16, 2006 Share Posted July 16, 2006 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.phpSID in a url is a way of passing a session id. Quote Link to comment https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58906 Share on other sites More sharing options...
gamernaveen Posted July 16, 2006 Author Share Posted July 16, 2006 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.!!!! ??? ??? ??? ??? :( :( :( ::) ::) ::) Quote Link to comment https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58908 Share on other sites More sharing options...
Joe Haley Posted July 16, 2006 Share Posted July 16, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58914 Share on other sites More sharing options...
gamernaveen Posted July 16, 2006 Author Share Posted July 16, 2006 Thanks. ;) 8) :-* Quote Link to comment https://forums.phpfreaks.com/topic/14760-php-sessions/#findComment-58916 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.