RedirectFromLogin?

H

HockeyFan

When in login code, how does the RedirectFromLogin know where to redirect?
What cookie or session variable (or whatever) does it use to know where to
go, and is this a writeable thing that I can make RedirectFromLogin to go
where I want it to go.
 
D

Dominick Baier [DevelopMentor]

it redirects to the returnUrl query parameter.

You can do that yourself with a combination of FormsAuth.SetAuthCookie and
Response.Redirect
 
H

HockeyFan

Can you clarify?
I have a user that hits a page, but they haven't logged in yet. I redirect
them to a NotAuthorized page, which lets them know they weren't authorized
and then redirects them to the login page.
So before redirecting to the login page, you're saying that I need to do
some call that will plug the query parameter "returnURL" to where I want them
to go when the ReturnFromLogin is called?
 
D

Dominick Baier [DevelopMentor]

Hi ,

when a user hits a page that needs auth - formsauthentication will redirect
to the specified in loginUrl in the <forms> config - this page will get the
originally requested Url as the returnUrl parameter -

formsauth.RedirectFromLogin pages picks this parameter up for redirection
back.

As i said you don't have to do that - you do a manual redirect to whereever
you want to - just set the auth cookie without automatic redirections and
call Response.Redirect afterwards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top