Re: How to do forms authentication with cookieless=UseUri?
- From: gnewsgroup <gnewsgroup@xxxxxxxxx>
- Date: Fri, 25 Jan 2008 20:38:28 -0800 (PST)
On Jan 25, 6:22 pm, bruce barker
<brucebar...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
you are confusing session and authentication. they are unrelated.
forms authentication create a login ticket and stores it in a cookie or the
url. session also creates a session ticket and stores it in a cookie or the
url. they can both use cookies, uri or be configured differently.
storing the login ticket in session just reduces the number of tickets sent
to the client.
cookie is slighty more secure (if you use https) because its not in the url.
the most secure is to not use forms authentication but rather a secure one
like kerberos or basic over https. then you store the login in the session,
and on every session fetch, check the the login matches the authenticated
user (thus preventing session hijacks)
-- bruce (sqlwork.com)
Thank you very much for the clarification. Right now, I am storing
the authentication ticket in a cookie like so:
Session.Add("UserName", username);
FormsAuthenticationTicket ticket =
new FormsAuthenticationTicket(1, username, DateTime.Now,
DateTime.Now.AddMinutes(20), false, "someuserdatahere");
string encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new
HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
Response.Cookies.Add(cookie);
Response.Redirect(FormsAuthentication.GetRedirectUrl(username,
false));
So, according to what you suggested, I could simply do:
Session.Add("authentication_ticket", encryptedTicket);
to stick it into the session and leave out the cookie part?
.
- References:
- How to do forms authentication with cookieless=UseUri?
- From: gnewsgroup
- Re: How to do forms authentication with cookieless=UseUri?
- From: gnewsgroup
- Re: How to do forms authentication with cookieless=UseUri?
- From: bruce barker
- How to do forms authentication with cookieless=UseUri?
- Prev by Date: Re: Using IIS w/ASP .NET 2.0 Web Application Projects
- Next by Date: RE: Data TAble declaration Problem
- Previous by thread: Re: How to do forms authentication with cookieless=UseUri?
- Next by thread: aspx and novell ldap login
- Index(es):
Relevant Pages
|
Loading