Magic2K2
September 9th, 2001, 14:36
Here is my plan:
When a user tries to log in, I match their username and password against my database. If the login is correct, I set the IP field in my member table to their IP and I set a cookie in their computer with the member id of their username. Then, for each page in my member's section I make sure that the computer accessing that username matches the IP in the database and that a cookie is set to that member id.
If they change the cookie, then the IP will no longer match so I am restricting them only to their account. The cookie is set to expire after 45 minutes so they are automatically logged out after that time.
Is this safe?
When a user tries to log in, I match their username and password against my database. If the login is correct, I set the IP field in my member table to their IP and I set a cookie in their computer with the member id of their username. Then, for each page in my member's section I make sure that the computer accessing that username matches the IP in the database and that a cookie is set to that member id.
If they change the cookie, then the IP will no longer match so I am restricting them only to their account. The cookie is set to expire after 45 minutes so they are automatically logged out after that time.
Is this safe?