Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Forms Authentication going back to previous page

Reply
Thread Tools

Forms Authentication going back to previous page

 
 
tshad
Guest
Posts: n/a
 
      01-31-2005
I have a logon page that is getting the previous page in its return URL
("logon.aspx?returnURL=A.aspx") where A.aspx is the page that called B.aspx.
It should have B.aspx.

I am calling B.aspx using server.transfer. Could this be causing a problem?

Thanks,

Tom


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      01-31-2005
Yes, that is the cause of the problem.

You don't need to use the default RedirectFromLoginPage if you don't want.
Instead you can use SetAuthCookie and then do a regular Response.Redirect to
wherever you'd like.
Here's more information:
http://authors.aspalliance.com/aspxt...uthCookie.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"tshad" <(E-Mail Removed)> wrote in message
news:u1aK1l%(E-Mail Removed)...
>I have a logon page that is getting the previous page in its return URL
>("logon.aspx?returnURL=A.aspx") where A.aspx is the page that called
>B.aspx. It should have B.aspx.
>
> I am calling B.aspx using server.transfer. Could this be causing a
> problem?
>
> Thanks,
>
> Tom
>



 
Reply With Quote
 
 
 
 
tshad
Guest
Posts: n/a
 
      01-31-2005
"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:ORni$o%(E-Mail Removed)...
> Yes, that is the cause of the problem.
>
> You don't need to use the default RedirectFromLoginPage if you don't want.
> Instead you can use SetAuthCookie and then do a regular Response.Redirect
> to
> wherever you'd like.
> Here's more information:
> http://authors.aspalliance.com/aspxt...uthCookie.aspx


That doesn't seem to be my problem. This was working fine before, not sure
what I did to mess it up.

I think I partially figured out what is happening.

I have pages A, B and C and a logon page.

Page A calls B (server.transfer("B"))

This should have went to logon as I have forms authentication on. But it
doesn't and I don't have as a Location in my web.config file.

Page B calls C (server.transfer("C")) and gets the logon page with B as the
returnURL (should have been C).

Tom.
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:u1aK1l%(E-Mail Removed)...
>>I have a logon page that is getting the previous page in its return URL
>>("logon.aspx?returnURL=A.aspx") where A.aspx is the page that called
>>B.aspx. It should have B.aspx.
>>
>> I am calling B.aspx using server.transfer. Could this be causing a
>> problem?
>>
>> Thanks,
>>
>> Tom
>>

>
>



 
Reply With Quote
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      02-01-2005
Try using Response.Redirect instead of Server.Transfer and see if that fixes
it.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"tshad" <(E-Mail Removed)> wrote in message
news:OoXkUz%(E-Mail Removed)...
> "Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
> news:ORni$o%(E-Mail Removed)...
>> Yes, that is the cause of the problem.
>>
>> You don't need to use the default RedirectFromLoginPage if you don't
>> want.
>> Instead you can use SetAuthCookie and then do a regular Response.Redirect
>> to
>> wherever you'd like.
>> Here's more information:
>> http://authors.aspalliance.com/aspxt...uthCookie.aspx

>
> That doesn't seem to be my problem. This was working fine before, not
> sure what I did to mess it up.
>
> I think I partially figured out what is happening.
>
> I have pages A, B and C and a logon page.
>
> Page A calls B (server.transfer("B"))
>
> This should have went to logon as I have forms authentication on. But it
> doesn't and I don't have as a Location in my web.config file.
>
> Page B calls C (server.transfer("C")) and gets the logon page with B as
> the returnURL (should have been C).
>
> Tom.
>>
>> "tshad" <(E-Mail Removed)> wrote in message
>> news:u1aK1l%(E-Mail Removed)...
>>>I have a logon page that is getting the previous page in its return URL
>>>("logon.aspx?returnURL=A.aspx") where A.aspx is the page that called
>>>B.aspx. It should have B.aspx.
>>>
>>> I am calling B.aspx using server.transfer. Could this be causing a
>>> problem?
>>>
>>> Thanks,
>>>
>>> Tom
>>>

>>
>>

>
>



 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      02-01-2005
"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:uiRxqI$(E-Mail Removed)...
> Try using Response.Redirect instead of Server.Transfer and see if that
> fixes it.


It did.

I was just reading up on it and it says that Server.Transfer keeps the old
URL and I assume that was why the returnURL had that page in it.

This would be a problem, then, if we are concerned with security as we have
a timeout and expect that if a person waits too long and goes to the next
page and had used Server.Redirect, it would go to the wrong page.

I was trying to use Server.Transfer as it was supposed to save resource, but
this would be a drawback.

Thanks,

Tom
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:OoXkUz%(E-Mail Removed)...
>> "Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
>> news:ORni$o%(E-Mail Removed)...
>>> Yes, that is the cause of the problem.
>>>
>>> You don't need to use the default RedirectFromLoginPage if you don't
>>> want.
>>> Instead you can use SetAuthCookie and then do a regular
>>> Response.Redirect to
>>> wherever you'd like.
>>> Here's more information:
>>> http://authors.aspalliance.com/aspxt...uthCookie.aspx

>>
>> That doesn't seem to be my problem. This was working fine before, not
>> sure what I did to mess it up.
>>
>> I think I partially figured out what is happening.
>>
>> I have pages A, B and C and a logon page.
>>
>> Page A calls B (server.transfer("B"))
>>
>> This should have went to logon as I have forms authentication on. But it
>> doesn't and I don't have as a Location in my web.config file.
>>
>> Page B calls C (server.transfer("C")) and gets the logon page with B as
>> the returnURL (should have been C).
>>
>> Tom.
>>>
>>> "tshad" <(E-Mail Removed)> wrote in message
>>> news:u1aK1l%(E-Mail Removed)...
>>>>I have a logon page that is getting the previous page in its return URL
>>>>("logon.aspx?returnURL=A.aspx") where A.aspx is the page that called
>>>>B.aspx. It should have B.aspx.
>>>>
>>>> I am calling B.aspx using server.transfer. Could this be causing a
>>>> problem?
>>>>
>>>> Thanks,
>>>>
>>>> Tom
>>>>
>>>
>>>

>>
>>

>
>



 
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
Best practices for using forms authentication and security in a hosted env (was: Re: Using a Forms authentication in a shared hosting environment) JEFF ASP .Net 1 11-12-2007 07:00 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
forms authentication returns 401 instead of going to login page Andy Fish ASP .Net Security 0 02-24-2005 03:15 PM
forms authentication returns 401 instead of going to login page Andy Fish ASP .Net 2 02-24-2005 02:16 PM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM



Advertisments