473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Forms Authentication going back to previous page

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
Nov 19 '05 #1
4 3236
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" <ts**********@ftsolutions.com> wrote in message
news:u1***************@TK2MSFTNGP09.phx.gbl...
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

Nov 19 '05 #2
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OR****************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:u1***************@TK2MSFTNGP09.phx.gbl...
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


Nov 19 '05 #3
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" <ts**********@ftsolutions.com> wrote in message
news:Oo****************@tk2msftngp13.phx.gbl...
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OR****************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:u1***************@TK2MSFTNGP09.phx.gbl...
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



Nov 19 '05 #4
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ui**************@tk2msftngp13.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:Oo****************@tk2msftngp13.phx.gbl...
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:OR****************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:u1***************@TK2MSFTNGP09.phx.gbl...
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



Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Senthil | last post by:
1. Created a new C# web application project 2. Change the name of webform1 to login.aspx 3. And in the .cs file change the name of the class to login, and include System.web.security namespace....
11
by: ElmoWatson | last post by:
I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying to get Forms Authentication working.....I can get...
3
by: Joey Powell | last post by:
This message was originally posted to the aspnet.security newsgroup, but no one there has ever heard of this before. That is why I am posting this message here, so that more people will see it... ...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
1
by: AVance | last post by:
Hi, I've come across this scenario in ASP.NET 1.1 with forms authentication where the forms auth doesn't seem to timeout correctly, nor redirect to the login page. I have done some testing, and...
6
by: Manny Chohan | last post by:
I am using forms authetication in the web config. i can validate a user against a database and click on images which makes hidden panels visible.However when i click on the link inside a panel...
4
by: WebBuilder451 | last post by:
I have an app that will direct to the login on any unauthorized access. It will redirect back to the calling page when authenticated. Now here is the problem. I'm allowing for user registration...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.