Hi I have a textbox that takes a username input. When the user submits the form, a cookie is created that stores the time of the cookie. On the next page, I need to display the time they were last logged in. How can I do this using the following cookie code?
SETCOOKIE($_POST['name'], time(), time() + 60*60*24*30);
You need to pass the users name everytime or save it in the server which is probably not the best solution here.. Why dont you have a static cookie name and do something like this when he logs in:
$_COOKIE['LASTLOGGEDINTIME']should retrieve the value.. do the necessary null/empty checks