phpSensei Posted September 3, 2007 Share Posted September 3, 2007 Whats it really used for? session_id(); ?? // I know its about the current session id, which is like some weird hash PHPSESSID // same thing.. why do you need these two things? I just don't get it! Quote Link to comment https://forums.phpfreaks.com/topic/67714-solved-whats-the-point-in-session-id/ Share on other sites More sharing options...
btherl Posted September 3, 2007 Share Posted September 3, 2007 In normal operation, the session id is placed in a cookie. The user's browser sends that to identify the session. PHP stores the session's data in a file using the session id as part of the name. It can be used in other ways (such as added to a url) and session data can be stored elsewhere (such as in a database), so the above is just the default mode of operation. Quote Link to comment https://forums.phpfreaks.com/topic/67714-solved-whats-the-point-in-session-id/#findComment-340182 Share on other sites More sharing options...
phpSensei Posted September 3, 2007 Author Share Posted September 3, 2007 so, its just another way of checking if the user is online? And, in conclusion, this operation is set when we register a session.... Quote Link to comment https://forums.phpfreaks.com/topic/67714-solved-whats-the-point-in-session-id/#findComment-340192 Share on other sites More sharing options...
btherl Posted September 3, 2007 Share Posted September 3, 2007 Sessions are usually used to track a particular user, and very often used to record that they are logged in. Session ids are part of the mechanism of sessions, which can be used to track a user, so the session id directly doesn't tell you the user is online. It's the session id as well as the contents of the session (such as $_SESSION['logged_in'] = true) that tells you the user is online. Yes, the id set for you automatically when you register the session. The cookie is also automatically set. Quote Link to comment https://forums.phpfreaks.com/topic/67714-solved-whats-the-point-in-session-id/#findComment-340216 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.