Most of website have a "Remember Me" checkbox on their website login page and you do not have to login every time you visit that website.
Bellow is a simple implementation for this task:
First of all you should know that this is a Cookie based solution and its not safe to store important data such ass password in cookies.
now lets get to the code.
First of all import
namespace in your code.
Then add a checkbox control in your login form and name it chkRemember.
then add the following code to click event of your login button:
HttpCookie cookie = new HttpCookie(“YourAppLogin”);
cookie.Expires = DateTime.Now.AddDays(15);
In the code above first we check if user has checked "Remember Me"
checkbox, if its checked then we create a HTTPCookie and we set an expiry date for it.
Now you should add this code to every page that requires login :
if (Request.Cookies["YourApLogin&"] != null)
string username = Request.Cookies["YourAppLogin"].Values["username"]);
This code checks the cookie and returns Username.