Login object - remember me
Posted: Thu Aug 23, 2018 10:30 pm
I look at the code generated here by WWB, at the end of it there are 2 lines
setcookie('username', $_POST['username'], time() + 3600*24*30);
setcookie('password', $_POST['password'], time() + 3600*24*30);
Then, after that:
$username = isset($_COOKIE['username']) ? $_COOKIE['username'] : '';
$password = isset($_COOKIE['password']) ? $_COOKIE['password'] : '';
1) It seems that there are 2 cookies created, why? Can't I create a cookie with several elemnts in it?
2) I want to store the flag $active 0 or 1 in it to be interrogated at log in time, do I need a 3rd cookie for that?
Cheers
setcookie('username', $_POST['username'], time() + 3600*24*30);
setcookie('password', $_POST['password'], time() + 3600*24*30);
Then, after that:
$username = isset($_COOKIE['username']) ? $_COOKIE['username'] : '';
$password = isset($_COOKIE['password']) ? $_COOKIE['password'] : '';
1) It seems that there are 2 cookies created, why? Can't I create a cookie with several elemnts in it?
2) I want to store the flag $active 0 or 1 in it to be interrogated at log in time, do I need a 3rd cookie for that?
Cheers