Ensure you have cookies enabled in your browser. Secondly, paste your full code if possible. Are you getting any PHP errors?
At 11/4/09 12:22 PM, Nishinku wrote:
ok so in login.php i start a session for the login containing the user id from the database.
Don't do this. Ever. All it takes is for somebody to modify the cookie and will then be able to be logged in as any other user (granted your user ids are sequential, e.g. an auto-incremented primary key). If you really need to save their state, store a unique, non sequential string such as a session id or anything similar that cannot be enumerated.
At 11/9/09 06:03 AM, BillysProgrammer wrote:
The most you should do with cookies that has to do with the login system would to be "remember me" kind of thing. If they choose say, a textbox, then they will have their email (or username) stored, possibly their password, and when they view the page again after they close the browser, the cookie would embed its contents into the input area specified.
A "remember me" function should, at most, store the username only. NEVER store the password in a cookie.