I am developing a website and i have written a standart login and register system in php with cookies. So when a user logges in, a cookie id and hash should be set into his browser. And they are being set correctly in all browsers except mobile google chrome. (In the desktop version is everything ok). The mobile chrome is the latest version. Here is the php code, that is executed after a user submits the login form and all the data is correct:
$hash = md5(generateCode(30));
setcookie("id", $data["user_id"], time() + (86400 * 30), "/", NULL);
setcookie("hash", $hash, time() + (86400 * 30), "/", NULL);
// redirecting the user to his profile
header("Location: lk.php");
exit;
I've tried adding the sleep function to give the browser some time to set cookies before redirecting, i've tried removing the redirecting but none of that helps. Note: I am developing on a proper domain and server, not localhost or ip. Thanks in advance for the help!
Aucun commentaire:
Enregistrer un commentaire