TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-12-2009, 05:26 PM   #1 (permalink)
The Visitor
 
praveenaj's Avatar
 
Join Date: Feb 2009
Posts: 3
Thanks: 1
praveenaj is on a distinguished road
Confused SECURED REMEMBER ME Login

Hello there,

I want to create a secured login form in PHP with the "Remember Me" option. If i use cookies to store user info such as "username" and "password" (encrypted hash) etc can anyone possibly use those for something shady?

Does anyone out there know if there's a way to achieve this in a more secured , bulletproof way ?

thanks in advance.
praveenaj is offline  
Reply With Quote
Old 02-12-2009, 10:08 PM   #2 (permalink)
The Contributor
 
Join Date: Feb 2009
Posts: 65
Thanks: 0
Krik is on a distinguished road
Default

Can cookies be used in a shady manner yes. Cookies can be faked and of course the risk is if someone logs in on a public PC who ever gets on that system after them can get into the site or even just copy the cookie for to edit and use on another PC.

Bullet proof login. Yes but I doubt you want to pay for that. There are companies that make multi-form login systems for the web. And outside of the most top end security needs you should be ok without them.

As to making a good remember me system. You will need cookies, with a twist and a bit of data stored on in a temporary database table.

First pass all cookies hashed. Use SHA to hash all cookie data before storing it on the users system. Include in that hash a one time id. I usually use a 6 digit number and using addition, subtraction, multiplication, division, I change that number based on 6 numeric time values and hash that to make an id that will never be the same ever again. I store that hash in the database and the next time they enter the site I retrieve the cookies and check all the hashed data including that id against what was in the database record form the last time they used the site. Of course if it all matches, including an IP address check, I let them in and delete the old cookie and database record and create a new cookies and database record.

Now that doesn't solve the issue of a user logging in and selecting the remember me on a public PC. But if that is an issue you need to do a risk assessment. If that were to happen whats the worst that could happen. If it is just spam on a forum not a big deal if you have good measures in place to deal with that. Or are we talking a more serious risk, like the unauthorized person would have access to data that could harm you personally. Now if that nefarious person gets access to that users personal info that user was the one that was negligent and you cannot be held liable for that as they left their data laying in the open for any other person to see and/or take.

And if there is serious risk (personal harm, data lose, or potential legal liability) you may want to eliminate a remember me system all together.
Krik is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Login to Any Account on an Insecure Site Wildhoney Tips & Tricks 18 12-14-2008 09:58 PM
First Login Script StevenF Absolute Beginners 33 02-15-2008 03:13 PM
Wordpress login and registration templates Haris Script Giveaway 2 01-27-2008 03:17 AM
user login page sarmenhb General 4 01-22-2008 09:33 AM
Highly secure login system ReSpawN Advanced PHP Programming 6 12-12-2007 08:28 PM


All times are GMT. The time now is 09:45 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design