idire Posted September 26, 2008 Share Posted September 26, 2008 I currently use sessions extensively throughout my website, but have had users complain about the lack of remembering login from a computer. I have looked up cookies, but don't really understand what I need to do to store/retrieve, and what to create? Quote Link to comment Share on other sites More sharing options...
Alkimuz Posted September 26, 2008 Share Posted September 26, 2008 you can set one by using the code: setcookie("name you wat to give to cookie", "the information you want to store in the cookie", the time you want the cookie to exist in seconds); so for example: $name = 'idire'; setcookie("UsersName", $name, time()+3600); you can read the cookie by using the code: $_COOKIE['Name of the cookie']; so for example echo 'hello '.$_COOKIE['UserName']; will show: hello idire good luck Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.