Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:674260
More Search Options
RSS Available
Matching Posts
Re: FormsAuthentication.Authenticate() fails after creating new user
ecbruck: If you need to redirect after validating the user, use the FormsAuthentication.RedirectFromLoginPage Method. I didn't mention FormsAuthentication.RedirectFromLoginPage, because I didn't want to assume this was a login page per se. It could have been a custom member creation scenario as well. In which case the aforementioned method lacks the control over the return URL destination. Cheers
Posted to
Security
(Forum)
by
leviticus
on 8/10/2006
Re: FormsAuthentication.Authenticate() fails after creating new user
leviticus: Use the following: if (Membership.ValidateUser(username, password) == true) { bool persist = false; // could use a remember me checkbox to toggle string url = "default.aspx"; // could grab the previous URL on Page_Load, before PostBack // and persist the URL in a State Bag (ViewState, Session, Cache, etc) FormsAuthentication.SetAuthCookie(username, persist); Response.Redirect(returnUrl, false); } else { // handle user not authenticating properly } It's unfortunate this forum doesn't support
Posted to
Security
(Forum)
by
leviticus
on 8/10/2006
Re: FormsAuthentication.Authenticate() fails after creating new user
Use the following: if (Membership.ValidateUser(username, password) == true) { bool persist = false; // could use a remember me checkbox to toggle string url = "default.aspx"; // could grab the previous URL on Page_Load, before PostBack // and persist the URL in a State Bag (ViewState, Session, Cache, etc) FormsAuthentication.SetAuthCookie(username, persist); Response.Redirect(returnUrl, false); } else { // handle user not authenticating properly }
Posted to
Security
(Forum)
by
leviticus
on 8/10/2006
Re: forms authentication timeout and persistent cookies
This is a potential work-around for use with cookie persistance: protected void Login1_LoggedIn(object sender, EventArgs e) { if (Response.Cookies.Count > 0) { foreach (string s in Response.Cookies.AllKeys) { if (s == FormsAuthentication.FormsCookieName) { if (Login1.RememberMeSet == true) { // change the value to increase the cookies expiration by Response.Cookies[s].Expires = DateTime.Now.AddYears(1); } } } } }
Posted to
Security
(Forum)
by
leviticus
on 8/9/2006
Page 1 of 1 (4 items)
Channel 9:
Ping 42: Is Microsoft cool? Photo DNA, Win7 tool, 10k MIX contest
Channel 9:
Jafar Husain: Silverlight Toolkit and Rx, Part 1
Channel 9:
Francesco Logozzo - Static Checking with Code Contracts for .NET
Channel 9:
Channel 9 Live at PDC09: Doug McCuistion, NASA
TechNet Edge:
System Center Operations Manager 2007 R2 – Service Level Dashboard part 3: Configuration
Channel 9:
Reading Debate with Bill Buxton
Channel 10:
Reading Debate with Bill Buxton
WindowsClient:
Build WPF Data Controls for Outlook Addins Easily with VS2010
Channel 9:
Channel 9 Live at PDC09: .Net Rocks Part 2
Channel 9:
Channel 9 Live at PDC09: .Net Rocks Part 1
Channel 9:
Channel 9 Live at PDC09: Wei Zhu (Facebook)
WindowsClient:
WPF Manipulation Basics
ASP.NET:
High CPU in .NET app using a static Generic.Dictionary
TechNet Edge:
Deploying Silverlight - Why and How
WindowsClient:
Windows Client Developer Roundup for 12/21/2009
IIS.NET:
SiteShell
Silverlight:
4 Calendars & Plans for 2010 / 5770
ASP.NET:
ASP.NET MVC 2 and Visual Studio 2010
ASP.NET:
Moving your ASP.NET Application to Windows Azure – Part II
Silverlight:
HVP – Core Scaffolding and Updated News
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online