Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2007, 05:49 PM
Authorized User
 
Join Date: Nov 2006
Location: Bracknell, Berks, United Kingdom.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Loading Password into Login Control

I have a login control on my website, but I want the users to be able to select the 'remember me next time' check box so when they return to the website the user and password are filled in already.
On the Login1_LoggedIN event I have save the username and password in a cookie successfully. Then on the Page_Load event I can read the cookie and retrieve the username and password. These I copy into the login control, except that the login1.password field is ReadOnly and so I can not set this up.

Is there a way to override this so that I can copy the password into the login control as well.

Thanks for any advice

Andy M


 
Old July 1st, 2007, 10:38 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

When I have implemented this type of feature, I don't even use the login control. If the user chooses to be remembered, why bother them with the step of logging in. My browser will remember my password too. If you notice on this very forum, if you choose to be remembered, you don't have to manually log in. The login information is in the cookie so you get logged in automatically.

-Peter
 
Old July 2nd, 2007, 03:31 AM
Authorized User
 
Join Date: Nov 2006
Location: Bracknell, Berks, United Kingdom.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, that is a nice feature. Can you point me to an example of how I would implement this.

regards

Andy M

 
Old July 2nd, 2007, 03:42 AM
Authorized User
 
Join Date: Nov 2006
Location: Bracknell, Berks, United Kingdom.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

On the otherhand, if you log out of this forum then the username and password are required again.
I think I would rather have the login control fields set up if 'remember me next time' has been selected, that way the password should only be required on initial login even when the user logs out.

Andy M

 
Old July 2nd, 2007, 08:17 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What happens when I use a public computer to check email, and accidentally check "remember me" then log in. Now, using your method, how do I ever clear my login on that computer? Do you then need to have a "don't remember me" checkbox or link?

I think the accepted behavior (at least this is what I have seen on every site that does it) is to perform an automatic login as long as you haven't logged out. Only when you log out does it revert back to force login.

Like I said before, if I have to click a login button every time even if my login details have been rememberd, it doesn't provide much convenience to me because most browsers can remember the passwords as well so what's the point?

As far as implementing it, just execute your regular login procedure automatically if you detect the presence of all the user's login info in the cookie.

-Peter
 
Old July 2nd, 2007, 09:00 AM
Authorized User
 
Join Date: Nov 2006
Location: Bracknell, Berks, United Kingdom.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok. I think you have a point there. I will execute the regular login procedure automatically when the presence of all the user's login info is detected in the cookie, as you suggest.

Thanks for your help

Andy M





Similar Threads
Thread Thread Starter Forum Replies Last Post
login and password airjaws Pro Visual Basic 2005 18 June 19th, 2007 04:21 PM
login and password airjaws Visual Basic 2005 Basics 5 June 18th, 2007 09:22 PM
Login/Password Java application larry Apache Tomcat 2 December 20th, 2005 04:42 AM
Login with username and password morpheus Classic ASP Basics 4 November 19th, 2003 11:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.