Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > FormsAuthentication doesn't redirect properly after timeout

Reply
Thread Tools

FormsAuthentication doesn't redirect properly after timeout

 
 
Danny
Guest
Posts: n/a
 
      06-17-2004
Hi there,

I was wondering if anyone would be able to shed some light on the
following behaviour for me.

I have an application that is using Forms Authentication with
non-persistent cookies, a forms timeout of 10 minutes, and a
FormsAuthenticationTicket Expiration of 10 minutes. Almost everything is
working as expected... when users try to enter restricted parts of the
site they are redirected to the login.aspx page that I have specified in
order to authenticate themselves. Once authenticated they are returned
successfully to the originally requested page.

(aside: I am able to do this using a call to
Response.Redirect(FormsAuthentication.GetRedirectU rl(txtUserName.Text,
false)); or FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text,
false); - either method works.)

If the timeout expires and the user then wishes to access some
restricted content again, they are booted back to the login page
(obviously, this is supposed to happen). The part that doesn't work as
expected is as follows:

After this timeout, once the user then successfully
authenticates themself again they do not get redirected to the page they
were trying for, instead they are redirected to default.aspx at the root
of the application.

I noticed that there is no ReturnUrl parameter present in the query
string when redirected to the login page following an authentication
timeout.

Hope to hear from someone.

Regards,

Danny


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      06-17-2004
Danny wrote:

> Hi there,
>
> I was wondering if anyone would be able to shed some light on the
> following behaviour for me.
>
> I have an application that is using Forms Authentication with
> non-persistent cookies, a forms timeout of 10 minutes, and a
> FormsAuthenticationTicket Expiration of 10 minutes. Almost everything is
> working as expected... when users try to enter restricted parts of the
> site they are redirected to the login.aspx page that I have specified in
> order to authenticate themselves. Once authenticated they are returned
> successfully to the originally requested page.
>
> (aside: I am able to do this using a call to
> Response.Redirect(FormsAuthentication.GetRedirectU rl(txtUserName.Text,
> false)); or FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text,
> false); - either method works.)
>
> If the timeout expires and the user then wishes to access some
> restricted content again, they are booted back to the login page
> (obviously, this is supposed to happen). The part that doesn't work as
> expected is as follows:
>
> After this timeout, once the user then successfully
> authenticates themself again they do not get redirected to the page they
> were trying for, instead they are redirected to default.aspx at the root
> of the application.
>
> I noticed that there is no ReturnUrl parameter present in the query
> string when redirected to the login page following an authentication
> timeout.
>
> Hope to hear from someone.
>
> Regards,
>
> Danny
>
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!


Are they (the users) sometimes doing a postback after the timeout,
instead of doing a GET for a page; is that the scenario that breaks?
Could be that .NET doesn't populate ReturnUrl if it's a POST that is
being done 'illegally', as it can't really 'put you back where you were'
after logging back in. Now if you were clicking on a simple link (a
GET), it knows it can put you back in that exact spot.

Just a guess...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FormsAuthentication doesn't automatically redirect upon timeout christine.nguyen@gmail.com ASP .Net 6 02-06-2008 09:10 PM
FormsAuthentication redirect after timeout christine.nguyen@gmail.com ASP .Net 2 02-05-2008 10:22 PM
formsauthentication timeout & session timeout =?Utf-8?B?Q3JhaWc=?= ASP .Net 1 08-10-2005 09:25 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
FormsAuthentication doesn't redirect properly after timeout Danny ASP .Net Security 0 06-17-2004 02:00 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57