Forum Moderators: coopster
$sesscookie = $_COOKIE['name'];
if ($sesscookie == "") {
if (!session_id()) {
session_start();
$sess_id = session_id();
setcookie('name', $sess_id);
}
$sess_id = session_id();
}
else {
$sesscookie = session_id();
}
What I'm trying to do is ensure that I have a single session id stored somewhere - a cookie if possible, and in a database record. Assuming it is stored in a cookie, I want the cookie value NO MATTER if the actual session id is changed.
If the cookie is NOT set (some browser settings disallow this) then I'll retrieve the original value of the session_id from the database. That code is not displayed here.
Am I understanding your question correctly?
I'm trying to figure out session id's and cookies... of course the page is live now, which makes my mistakes even bigger. Basically I'm just trying to work thru what I know, what I think I understand, and what is right. I'll have a look at the resources you pointed to.
FWIW, right now everything seems to be working good. I had that same sense 3 days ago...
Thank You