• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

How to remember User in Login Page?

In my ASP.Net website, I have login page where the user has to Login before entering the website. In Login Page, I have Remember Me check Box, if the user checks this check box, I want to remember the user, like how it happens in the Mail websites.
I need help in doing this.
Can anyone help me to doing this?
Thanks
0
ASPNet_Developer
Asked:
ASPNet_Developer
  • 3
  • 3
  • 2
1 Solution
 
haloexpertsexchangeCommented:
Set a cookie with the user information and then when the user comes back again, look for the presence of the cookie, if you find it they are automatically logged in.
0
 
safiintCommented:
just do this:

string username = "";    //username entered by user
FormsAuthentication.RedirectFromLoginPage(username, chkRemeberMe.Checked);
0
 
haloexpertsexchangeCommented:
here is an explanation on how to use cookies.
http://msdn.microsoft.com/en-us/library/ms178194.aspx
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
ASPNet_DeveloperAuthor Commented:
I donot want to use cookies for security reasons, is there a way to do this without cookies?
0
 
ASPNet_DeveloperAuthor Commented:
safiint:
string username = "";    //username entered by user
FormsAuthentication.RedirectFromLoginPage(username, chkRemeberMe.Checked);

Where should I apply this?
0
 
haloexpertsexchangeCommented:
are you using the asp.net login control?
If so it looks like that uses cookies to remember users as well.
The only other thing that I could think of would be to get the ip address of a user after they have logged in for the first time and store that in a database somewhere which could then be looked up and by that you could log someone in.
But that is also potentially risky since ip addresses change and they often will so someone would easily no longer be remembered and then especially in a corporate environment you have ip addresses that may not be used by the same person every time and then you could accidentally log in the wrong person.
0
 
safiintCommented:
if you don't know this method, then you are using asp.net login control.

in this approach you can't use this method.

even though, this method used the cookies
0
 
ASPNet_DeveloperAuthor Commented:
Thnaks.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now