Saturday, October 27, 2007
« "Access Denied" Error When Trying to Con... | Main | 8 Reasons to Join Semingo Now »

With ASP.NET Forms Authentication it's easy to setup a login page.
What if you want to make the login functionality more seamless? That's quiet easy too.
Remember that Forms Authentication uses a cookie to distinguish an authentication user from an unauthenticated user.
Here's a recipe for setting up an AJAX-style login:
1. Collect the user/password and send them to the server using AJAX.
2. On the server-side handler, verify that the user/password combination is correct and add the authentication cookie using the FormsAuthentication.SetAuthCookie method.

Now, the authentication cookie will be appended to subsequent requests to urls within your application.

More on Forms Authentication at pashabitz.com:
Security Issue with FormsAuthentication.RedirectFromLoginPage

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Sunday, October 28, 2007 2:27:13 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0]  
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):