[Mono-dev] Response.Redirect possible exception when using forms authentication
Dieter Bremes
dbjobs at snafu.de
Fri Dec 16 06:31:39 EST 2005
Carlos Solorzano wrote:
>
> On Dec 16, 2005, at 2:55 AM, Carlos Solorzano wrote:
>
>> I am using forms authentication with XSP on mono 1.1.10.1
>> Whenever a user logs in, sometimes, the login page never responds
>> after entering the username and password. I went ahead and tried to
>> figure out where its getting stuck. I am almost certain now that the
>> End() method on HttpResponse.cs can throw the exception given below.
>> Try Catching that exception makes my forms authentication work
>> correctly almost always now.
>> Is there maybe something wrong I could be doing on my code? I know
>> that sometimes having Try Catch blocks on Redirects can cause
>> problems but I don't have any as far as I can tell, either-way I
>> think an error should be shown to the user if thats the case, right
>> now the code just doesn't respond.
>>
>> Anyways here is the exception:
>>
>> System.Threading.ThreadAbortException: Thread was being aborted
>> in (wrapper managed-to-native)
>> System.Object:__icall_wrapper_mono_thread_interruption_checkpoint ()
>> in (wrapper managed-to-native) System.Threading.Thread:Abort_internal
>> (object)
>> in <0x0001a> System.Threading.Thread:Abort (System.Object stateInfo)
>> in <0x00071> System.Web.HttpResponse:End ()
>
>
>
> I changed my code to not do a RedirectFromLoginPage() but instead get
> the authentication cookie and do a Response.Redirect(url,FALSE), and
> that FALSE made it all work again. What I don't understand is what is
> keeping the thread from being aborted, is there an easy way to find
> that out? and why is no error actually showing up on the page?
>
> --Carlos
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
Hi Carlos,
looks like in FormsAuthentication.cs
public static void RedirectFromLoginPage (...)
{
// ...
Redirect (GetRedirectUrl (userName, createPersistentCookie));
}
should be
public static void RedirectFromLoginPage (...)
{
// ...
Redirect (GetRedirectUrl (userName, createPersistentCookie), false);
}
http://weblogs.asp.net/bleroy/archive/2004/08/03/207486.aspx explains it.
Dieter
More information about the Mono-devel-list
mailing list