I have used sessions all over my website. I have now made a webview android application so it's easier for me and my users to access my website.
The problem with sessions is that when the app/browser closes - the session is destroyed. I wan't to keep that option though - but I would also like to make a "remember me" function.
When I log in. Could I then do something like this:
$UserId = "TheUserId";
if($RememberMe == 1) {
setcookie('userid', '".$UserId."', time() + (86400 * 30 * 14), "/");
} else {
setcookie('userid', '".$UserId."', 0, "/");
}
Will the last cookie be deleted after the browser closes and will the first cookie stay around for 14 days?
Thank you very much.