Jump to content

User Authentication


rockinaway

Recommended Posts

Okay, at the moment, when a user logs into my website a token is created. The token is made from a random code, their name and their email. This token is then stored next to their name in the DB.

 

If the user chooses to be remembered, the token is stored as a cookie, otherwise it's stored as a session var.

 

Every time a page is loaded, a comparison is made between the DB token and the session/cookie token to authenticate.

 

HOWEVER, this does not work if the user decides to login from different locations/ip addresses. How would I go about allowing this? Could I created a table and then store the IP address and the token for that IP address?

Link to comment
https://forums.phpfreaks.com/topic/251810-user-authentication/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.