Re: forms authentication redirect problem



RedirectFromLoginPage simply call 2 APIs that you can call yourself,

1. FormsAuthentication.SetAuthCookie to set the ticket
2. Response.Redirect(FormsAuthentication.GetRedirectUrl(..))

2 does the redirect and you can do it yourself.

Hi All,

I am developing using ASP.NET using VB on .NET framework 1.1.

I have an application that uses forms based authentication. When the
session times out and sends the user back to the login page, I see
that it populates a return_url value and adds it to the url. Such that
when the user then authenticates, the
FormsAuthentication.RedirectFromLoginPage then uses the return_url to
return the user back to the page they were on when the session
expired. All well and good, but, some of my pages rely on the previous
content of the session variables to be able to populate the page they
were previously on.

Is there any way of preventing the redirect to the return_url, eg by
using something instead of FormsAuthentication.RedirectFromLoginPage,
that only ever takes the user to the mainmenu page? Or, do I need to
add checking for the existence of the required session values on each
page (rather painful if I do have to).

Please be gentle, I am not very experienced with ASP.NET as you may
see by
my question.
Thanks in advance
Janette


.



Relevant Pages

  • Re: how to time out the web asp.net application when not in use for 15 minutes
    ... I really think you'll have an easier time adopting Forms authentication. ... > when the session is time out asp.net application goes to session_end ... > How do I redirect now? ... >> there's no request, there's no where to transfer to. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Help Needed: Cant Successfully Perform Server-side Redirection
    ... The only problem that I really have is session timeouts. ... situations and redirect the user to the Logon page. ... If Not IsLogonPage And Not IsLogOffPage Then ... Dim ExpirationInterval As Integer = Settings.TimeoutMinutes ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Gracefully Handling Logged Out User
    ... > Session has nothing to do with Forms Authentication. ... > automatically redirect them to the login page. ... > The one issue you'll see is that, if the request which required ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: session value lost
    ... >into as sessionvariable (username). ... So I redirect to my search.aspx. ... >I save the recordid to the session and redirect to work.aspx. ... >new sqlstring I fetch the data from the sqlserver. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Domain Redirect - loses session variables
    ... I purchased this Domain from DirectNic and they have the option to redirect ... with no frame which works like a charm. ... Session variables are saved and it works great! ... >>> from one domain to the other through some shared data storage. ...
    (comp.lang.php)