I do have this activity of mine where we have something like a 'username' and 'password'. function. the idea is, once you've inputted data for username and password in the login page, you just need to incorporate the user with cookies - upon clicking the submit button.

Here's the thing. once he logged in once and closed the browser, and if he decides to enter your page, he can automatically logged in that page.

Apart from the fact that you probably shouldn't store the password in a cookie as plain-text your code seems to do what you want.

Is there a problem? There's quite a lot of code to read up there and I can't be arsed to read all of it, so a pointer to where you think the problem is would be very helpful.

11-06-2008, 07:01 PM

Norm

Quote:

need to incorporate the user with cookies

Once the password is validated, no need to use it in a cookie.
Create a unique string of some kind to use as the cookie and save it locally where it can be retrieved when needed. It could be associated with other info for the user. It could have other attributes like expiration date etc.