-
Mar 10th, 2004, 08:15 PM
#1
best way to "update" cookies
Ok, I've never used cookies a whole lot, but I want to make a neat login for some blogging software I'm writing and not have to have the user re-enter information every time they go to the site, well, unless they want to. So, basically, I'm going to have an option; use cookies on login, or don't, and use a session instead. Now, I've never used sessions at all, but aside from that, I want to know what the best way to update a cookie is.. After a user is logged in, I want them to have their login information stay stored in an active cookie as long as they are active on the site, and this will make them never re-login if they are visiting every day. I know many message boards do this; phpBB, vBulletin and Invision for example, as I haven't actually logged into this board for over 3 months. I'm thinking of having an include that just sets a cookie for every visit, and include it in a header that will be included in every page.. but I think that'd be overkill. I'm thinking of it as it will make a new cookie every time it's executed, rather than update the current cookie if there is one.
Not sure if I made myself clear; but any help is appreciated.
-
Mar 10th, 2004, 08:42 PM
#2
Ex-Super Mod'rater
As far as I know if you try and set a cookie and the name is already being used it will overwrite the old cookie so effectively updating it .
When your thread has been resolved please edit the original post in the thread ( )
and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.
-
Mar 10th, 2004, 11:21 PM
#3
Stuck in the 80s
Re: best way to "update" cookies
Originally posted by kows
I'm thinking of having an include that just sets a cookie for every visit, and include it in a header that will be included in every page.
That's exactly how I do it in my programs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|