First off, if anyone can recommend a good tutorial on creating a login process using cookies and sessions, feel free to help a kid out.
Secondly, I’m trying to figure out what the best approach is with using a cookie-session with a login process. I feel a bit silly trying to make this on my own as I’ve never done it, but hey–now is as good of a time as ever, right?
So to that end, I keep telling myself that I should check for the cookie before outputting any login form and if a cookie is found (with the appropriate data), then it will either let you in or force the auth on ya. After that, the session information would be injected into the cookie…? Is that close?
Anyway, if anyone could shine some general light on the general process, I would be appreciative.
Dan, I really appreciate the code. I think the thing I was a bit foggy on is when and where to include the session stuff. Thanks for clearing that up. What about the cookie implementation? Is that just the simple “setcookie()” stuff or is there more to it than that?
I was thinking that the cookie could be used to keep the person logged-in while also retaining various settings that the person might wish to keep, such as the way a DIV is displayed or whatever.