ASP.NET Tip: Persistent Logins Under ASP.NET 2.0
For starters, you'll need to add a block to your Web.config to enable FormsAuthentication:
<authentication mode="Forms">
<forms name="MyApplication" loginUrl="/login.aspx" />
</authentication>
<authorization>
<deny users="?"/>
</authorization>
FormsAuthenticationTicket t =
new FormsAuthenticationTicket(1, userID,
DateTime.Now, DateTime.Now.AddMonths(3),
chkSave.Checked, userID.ToString(),
FormsAuthentication.FormsCookiePath);
string encTicket = FormsAuthentication.Encrypt(t);
HttpCookie c = new HttpCookie(FormsAuthentication.FormsCookieName,
encTicket);
if (chkSave.Checked)
c.Expires = DateTime.Now.AddMonths(3);
Response.Cookies.Add(c);
BACKLINK
Hi , Tarun Gupta
ReplyDeleteIt a really nice site .
Incredible
Keep it up !
mapmyindia......cool work dude. I am impressed. Never seen it nethin like this before.
ReplyDelete