Hi everyone,
I have a question about sessions. I have the following code and I do not know why the session ID is not being "echoed" by the line "echo $cookieinfo". I seems like 2 possiblities:
1) The cookie wasn't set properly with the session ID
2) Some code here does not retrieve the session ID properly - the "$cookieinfo = $HTTP_COOKIE_VARS["sessionIDSet"]" line ??
Thank you for any input!
check for a cookie on the client's side called sessionIDSet
$cookieinfo = $HTTP_COOKIE_VARS["sessionIDSet"];
if there is a cookie, get it and retrieve the session id
if($cookieinfo == session_id()){
resume the previous session
session_start(session_id());
$sesid = session_id();
echo $cookieinfo;
else{
session_start();
set the Cookie with the session ID setcookie("sessionIDSet", session_id(), time() + 60 * 60);
}