473,396 Members | 1,757 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,396 software developers and data experts.

ReturnURL

When I logout of my application I redirect to the login page. However the
ReturnURL is placed in the querystring so if the user logs back in it goes
back to the last page where the logout occured. The behavior I'm looking
for is to only use the ReturnURL if the Session timesout.

Logout event found on every page in the application:

Private Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogout.Click
UpdateItem()
If (User.Identity.IsAuthenticated) Then
System.Web.Security.FormsAuthentication.SignOut()
End If
Session.Abandon()
Response.Redirect("default.aspx")
End Sub

Login on default.aspx:
....check login credentials, if ok then

FormsAuthentication.SetAuthCookie(txtUserName.Text , False)
If Request.QueryString("ReturnURL") = Nothing Then
Response.Redirect("private/app_start.aspx")
Else
FormsAuthentication.RedirectFromLoginPage("txtUser Name.Text", False)
End If
Nov 18 '05 #1
0 1817

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

Similar topics

2
by: tshad | last post by:
I have a logon page that is may be called by the Forms Authentication setup. This would put a ReturnURL as part of the URL. I would normally then just issue a: ...
1
by: Randall Parker | last post by:
I'm coding up C# CodeBehind source code for a Logon.aspx file. I have a newbie few questions: 1) If a PostBack comes in and you return from it (rather than redirect) then will the original...
4
by: Chicagoboy27 | last post by:
All I am trying to find a solution for removing the ?returnUrl if a user is not authenticated. I want to be redirect an unauthenticated user to the login.aspx less the returnUrl. Once they log...
7
by: vvkl | last post by:
I have readed a example code from MSDN about FormsAuthenticationTicket calss, but there's a line I can't understand : 'strRedirect = Request;' What's the mean in which square brackets? Thank...
0
by: mark4asp | last post by:
The login page is: http://localhost:1086/Client/Default.aspx The default page is: http://localhost:1086/Client/News/News.aspx i.e. I have the following in web.config <authentication...
1
by: mark4asp | last post by:
Ok so my previous message about the vanishing ReturnUrl value was also lost! - grrrr Fate - I'll get my revenge on you - if you think you can toy with me like this! I decided to change the form...
10
by: semomaniz | last post by:
Hello, I have a database interface that needs to have a login authentication set up. SO for this I have a login view inside which i have the login control and i have accomplished the...
0
by: tranky | last post by:
Hi, i've a problem, and i know you can help me to solve it. I'm using Asp Net and Form Authentication. When i'm anonymous and i must show a protected page, i'm redirected into a login.aspx page...
1
by: tranky | last post by:
Hi, i've a problem, and i know you can help me to solve it. I'm using Asp Net and Form Authentication. When i'm anonymous and i must show a protected page, i'm redirected into a login.aspx page...
0
by: tranky | last post by:
Hi, i've a problem, and i know you can help me to solve it. I'm using Asp Net and Form Authentication. When i'm anonymous and i must show a protected page, i'm redirected into a login.aspx page...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.