I'm creating a website which has a login function. Once the user logs in, they are shown a button that allows them to log out. When the user logs in, a boolean variable on the server is changed to "true", because the user has logged in. When the user clicks the logout button, the boolean variable changes to "false". My question is, should I be storing this information in a http cookie instead of a variable? (I'm thinking that storing this in a variable on the server might slow down the website.) I'm using this variable for the purpose of letting the user go directly to the website the next time they visit if they haven't logged out, instead of having to login every single time.
Jump to Post
There are pros and cons to using a cookie to store login variables for a website.
- Cookies can be set to terminate either at end of session or after a specified time period
- Cookies are relatively easy to write/read
- Cookies are client side and don't require much …
Jump to Post
Perhaps I wasn't 'clear' enough with my answer then :P
From what you had said:
>>My question is, should I be storing this information in a http cookie instead of a variable?
And you had indicated one of the concerns was overall processing requirements compared to your variable …
All 6 RepliesReply to this topic
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.