vijdev Posted August 9, 2010 Share Posted August 9, 2010 i want to store the nickname of the user as a cookie.. somthing like set cookie name=nickname,value=smarty,expires after 1 week i know cookies are stored against domain names. what happens when another person logs in the same computer, with different login, and his nickname is diff how does the cookie get handled, and how does the right nickname flash against the right persons login id... Quote Link to comment https://forums.phpfreaks.com/topic/210262-cookie-q/ Share on other sites More sharing options...
gizmola Posted August 9, 2010 Share Posted August 9, 2010 It doesn't. Cookies are associated with the browser, so there's no concept of user. The system has no way of knowing if you are sitting at your computer, get up and someone else sits down in your chair. Quote Link to comment https://forums.phpfreaks.com/topic/210262-cookie-q/#findComment-1097253 Share on other sites More sharing options...
vijdev Posted August 10, 2010 Author Share Posted August 10, 2010 well yes, i meant same computer,same browser...2 guys login to my site, and i use cookies to store the nickname. how does cookie work, to recall the respective nick name in each guy's login? Quote Link to comment https://forums.phpfreaks.com/topic/210262-cookie-q/#findComment-1097464 Share on other sites More sharing options...
Wolphie Posted August 10, 2010 Share Posted August 10, 2010 The cookie value would be over-written with the new users login details. For example one user logs in as "test1", the nickname cookies value is now "test1". If that user logs out, and a different user named "test2" logs in, then that cookie would be over-written with "test2". Although, when a user logs out, the cookie information should be deleted any way and then set again if a login occurs. Quote Link to comment https://forums.phpfreaks.com/topic/210262-cookie-q/#findComment-1097470 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.