Re: FormsAuthentication.RedirectFromLoginPage()



Response.Redirect works.

Maybe there is some problem in your cookie code and you get bounced back again to login.aspx....?!

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Greetings MS ASP.Net Community,

I am using forms authentication for a site we've been developing. All
users valid on our Windows domain are eligible to access the site, but
are enrolled in the application upon initial login by insertion of a
record into a [User] table located in a SQL Server database.
Insertion of this record creates an "anonymous" machine generated user
ID for them. (The system is a ride sharing / carpool application and
implements a double blind messaging feature.) New users are also
required to agree to the "Terms of Service" that our legal dept. has
composed for this application. So, the login form is taking care of
all of this for me. It only grants an authentication ticket after
verifying that:

1. the user is on the domain
2. the user has been enrolled by insertion into the [User] table
3. the user has agreed to the current "Terms of Service"
Normally, an existing user is redirected from login to a default page
showing their matching commuters (where they can message potential
matches anonymously, etc.) However, when the user is a brand spanking
new user who is accessing the site for the first time I would like to
redirect them from the login page to a "welcome" page that informs
them about their anonymous ID and the double-blind messaging feature,
etc.

The problem I seem to have is that when I manually add the cookie for
the authentication ticket to the outgoing cookies collection and try
to invoke a statement such as:

Response.Redirect("Welcome.aspx", False)

the user is not redirected, but receives the login page again.

Is it possible to redirect from the login page to a page other than
the one requested by the user ... i.e.
FormsAuthentication.GetRedirectURL()? Seemingly, I can only redirect
the user from the login page via:

FormsAuthentication.RedirectFromLoginPage()

Ok, I think that pretty much sums it up.

Any help will be greatly appreciated.

Sincerely,
Mark


.



Relevant Pages

  • Re: Accessing and displaying SSL web pages and cookies from a windows form
    ... or LoadXML calls to urls on the website in order to get data or post data to ... first redirected to a SSL login page, if a particular cookie is not present, ... cookie is not present instead of getting the data. ... >> the data in the cookie and also not redirect to the login page. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: A little problem with Forms authentication :-(
    ... I'm using forms authentication and the user is getting authenticated no ... should be redirected to the login page. ... I've set the time out for the cookie to the test value of 1 ... redirect from login bit because as I understand it, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Forms Authentication Not Redirecting To Login Page
    ... Dominick Baier - DevelopMentor ... > is activated and the user is hence unauthenticated, the browser window ... > is on sometimes redirecting back to the login page. ... > requested will redirect to the login page correctly. ...
    (microsoft.public.dotnet.security)
  • Re: Accessing and displaying SSL web pages and cookies from a windows form
    ... > I have a website that uses an ISAPI filter that will redirect anyone going ... > cookie and redirected back to the page they initially tried to go to. ... > website and utilizes that SSL login form and the session cookie generated ... > the data in the cookie and also not redirect to the login page. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Role based security question
    ... you could do that in your login page - query the roles and do a response redirect.. ... Dominick Baier - DevelopMentor ... How can I restrict access to portions of the site unless the appropriate login is provided, but not require a login for the site as a whole? ...
    (microsoft.public.dotnet.framework.aspnet.security)