Jump to content

Authentication


nadeemshafi9

Recommended Posts

Hi guys

 

Just wanted to ask what is the best hack proof way way of authenticating a user i have a few ideas

 

1. use a session user is authenticated flag to say the user is authenticated

 

2. use a hashed timestamp and insert it into the users record and into a session variable and compare them whilst the user surfs.

 

3. store the hashed pwd and username in a session variable and log in the user each time on every opage , this would mean last login time would be hard to get.

 

 

any sugestions please, thanks

Link to comment
Share on other sites

I'm pretty new to trying to secure logins and stuff, but from listening to everyone on this forum, here's what I do.

 

When they login without clicking "remember me" I store a uniqueID on a cookie set for about 25 minutes.

I then store that same uniqueID in a table along with their userID and an expiration date.

On any page where they need to be authenticated, I check for the uniqueID in the cookie, if its there, I get their user info from the userID in the table.

 

When they login and click "remember me", same thing, only the cookie is set for about 30 days.

 

I figure I will delete all entries in the table everyday where the expiration date expired.

 

Like I said, I'm not super good at this stuff yet, but this seems like a secure system to me.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.