hello,
how can i set cookies like ‘last_visit’ if the user have more than one account on my site
i tried some methods but i failed.
that`s the code when the user log out
setcookie('last_visit',time(),time()+60*60*24*30*12);
but when the user relogin with another account the page read the last visit of his first account with this code
$lastvisit = $_COOKIE['last_visit'];
can i link the last visit cookie with the user id cookie in one cookie
please help me with the right method
Try to remove existing or old cookies when writing new ones. Do a mutually exclusive login, when people log in to one account they are sign-out from the others.