Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
save password in cookie
Old 09-21-2010, 11:09 PM save password in cookie
Extreme Talker

Posts: 173
Trades: 0
I access a website that allows a user to save the login but not the password in a cookie. I am forever being asked for the password everytime I want to access the site which is several times through out the day.

How can I have the password autopopulate the same way the login is done?

Generally speaking, I have a link that takes me to the site that then asks for the password. I can control the link to the site that asks for the password if that makes any difference.
dgkindy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-22-2010, 12:35 AM Re: save password in cookie
Ultra Talker

Posts: 366
Name: Steve
Location: Miami, FL, Earth
Trades: 0
dg, you're not giving enough info... what's the code for the login page?
__________________
- Steve

President,
Please login or register to view this content. Registration is FREE
smoseley is offline
Reply With Quote
View Public Profile Visit smoseley's homepage!
 
Old 09-22-2010, 05:22 AM Re: save password in cookie
PeterRossy's Avatar
Experienced Talker

Posts: 27
Name: Peter
Location: USA
Trades: 0
Password encryption is a must.
The strength depends on the type of encryption and its classification. Passwords for web apps are often stored as hashed passwords which means that they cannot be reversed to retrieve the original password. MD5 is a common hashing algorithm used for this purpose, and I believe its collision probability is 2^128 - 1 (if someone with more cryptography knowledge could confirm this). I can't even calculate that number, though I recall hearing that a method has been created that compromises this hash - I'll see if I can track down the link, but it was awhile ago.
I generally do md5 with an added salt. So, in my database I have a record for a user containing their password which was calculated from md5(md5($password) . $salt), and when I store cookies I just use the md5($password) and later retrieve the salt, recalculate and compare. The added salt is nice since if you're db is ever compromised then even the same passwords used appear different in their hash.
For autologins the only real option is to use a cookie. And if they forget to uncheck the shared computer option then the next person that uses it will automatically be logged in (if its the same user account). The only alternative is to also store an ip address in the database and use that. This is not reliable as IPv4 is often reassigned on dynamic hosts, so this method would work for something like a business environment, but not a public environment since its not overly secure. If you could get the mac address its would be much more secure, but this is almost impossible in PHP; I've managed to retrieve the mac using an IIS server and exec with... ntds I think it was, but haven't figured out a solution using Linux yet. BTW, this has extreme, and I mean extreme overhead to perform the calculations for it.

I hope that helps point you in the right direction - I know that I tend to ramble, so hopefully it doesn't confuse you :P
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
PeterRossy is offline
Reply With Quote
View Public Profile Visit PeterRossy's homepage!
 
Old 09-22-2010, 05:39 AM Re: save password in cookie
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
DO NOT EVER store passwords in cookies, encrypted or not.

Once a login is successful set a "LoggedIn" flag in the cookie/session expire the cookie after 12 hours or 24 hours or longer depending on the site.
That way the server code checks the flag and does not request a password for that user.

BTW none of this is possible with HTML (which is this forum category)
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-22-2010, 05:41 AM Re: save password in cookie
Skilled Talker

Posts: 59
Trades: 0
That's great info Peter. Thanks a ton.
__________________

Please login or register to view this content. Registration is FREE
jack_ham is offline
Reply With Quote
View Public Profile
 
Old 09-22-2010, 06:23 AM Re: save password in cookie
Novice Talker

Posts: 11
Name: John Brown
Trades: 0
I think you want to be able to enter the username and password automatically. This can be done with the browser itself. Usually the Mozilla Firefox asks for remembering the user ID and password and it is easy to do so. If you are also complaining that even though you check the remember me option at every login, you are asked for user ID and password, its nothing you can do. Probably a script error must be there for not allowing to save the details. On a side note please check whether you have cookies enabled or not.
__________________
Always Keep Smiling :)
iamjohnbrown is offline
Reply With Quote
View Public Profile
 
Old 09-22-2010, 06:30 AM Re: save password in cookie
Experienced Talker

Posts: 41
Name: vinay
Trades: 0
dear friend you question is confusing. tell you want to do this for a website that you visit or you want to do this in your projected website that you are developing. I think answer for both frnds have already given which are best
vinay.desi9n is offline
Reply With Quote
View Public Profile
 
Old 09-23-2010, 08:52 PM Re: save password in cookie
Crimson's Avatar
Skilled Talker

Posts: 56
Name: Connor
Location: United States
Trades: 0
Are you asking for help saving your own password, or are you building a website where you want to remember user passwords? Very different question, but I think you're asking the first. Most web browsers have some kind of password saving feature, or you could use a separate program like RoboForm or 1Password.
__________________

Please login or register to view this content. Registration is FREE

I solve code problems, browser compatibility (including IE 6), Wordpress trouble, the works.
Crimson is offline
Reply With Quote
View Public Profile Visit Crimson's homepage!
 
Old 09-27-2010, 08:52 AM Re: save password in cookie
Skilled Talker

Posts: 59
Trades: 0
Thanks for such a detailed info Peter! very informative indeed.
__________________

Please login or register to view this content. Registration is FREE
jack_ham is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to save password in cookie
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56042 seconds with 12 queries