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

Login / Logout

I have an asp.net application using forms authentication.

1. It has a simple login page (login.aspx) that uses
FormsAuthentication.RedirectFromLoginPage(. . . ).
2. My application has a logout function that Redirects to signout.aspx.
Signout.aspx invokes FormsAuthentication.Signout() when it loads.
3. Signout.aspx also has a login button that redirects to my application
page (index.aspx). Because the user is no longer authenticated, asp.net
properly invokes the login.aspx page.
4. If I login again using the same user id, no problem - I go right to
index.aspx.
5. However, if I login using a different user id, I get redirected to
signout.aspx. I've tested the value of FormsAuthentication.GetRedirectUrl(.
.. . ) and it is clearly setting the RedirectUrl to signout.aspx.

Is there some way to prevent this from happening? Is it possible to set the
RedirectUrl using my .Net code? Better yet, is there a recommended way to
implement a login / logout function that will allow different user ids?

Nov 19 '05 #1
1 2421
Instead of relying on RedirectFromLoginPage you can do the same via
SetAuthCookie and a response.redirect. You can get the redirect URL via
GetRedirectURL

http://msdn.microsoft.com/library/de...ookietopic.asp

and

http://msdn.microsoft.com/library/de...cturltopic.asp

HTH
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"MichaelR" <ad***@info-resonance.com> wrote in message
news:u7**************@tk2msftngp13.phx.gbl...
I have an asp.net application using forms authentication.

1. It has a simple login page (login.aspx) that uses
FormsAuthentication.RedirectFromLoginPage(. . . ).
2. My application has a logout function that Redirects to signout.aspx.
Signout.aspx invokes FormsAuthentication.Signout() when it loads.
3. Signout.aspx also has a login button that redirects to my application
page (index.aspx). Because the user is no longer authenticated, asp.net
properly invokes the login.aspx page.
4. If I login again using the same user id, no problem - I go right to
index.aspx.
5. However, if I login using a different user id, I get redirected to
signout.aspx. I've tested the value of FormsAuthentication.GetRedirectUrl(. . . ) and it is clearly setting the RedirectUrl to signout.aspx.

Is there some way to prevent this from happening? Is it possible to set the RedirectUrl using my .Net code? Better yet, is there a recommended way to
implement a login / logout function that will allow different user ids?

Nov 19 '05 #2

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

Similar topics

0
by: konsu | last post by:
hello, i need to implement a secure web site in php and mysql but i have just started looking at php a few days ago, and i would appreciate any advice from the experts. the site, as i said,...
7
by: Angelos | last post by:
Any Suggestions for an Authentication System ... Do you have any Links to suggest ? My current Authentication works ok but it has a major BUG !!! BUG: If I use the same Authentication mechanism...
2
by: Brian Henry | last post by:
We have our windows forms login set up and working good, well it works at least, just now we need a logout button, so when you click on it, the user will be logged out of the authentication, how...
2
by: Eduard Witteveen | last post by:
Dear list, In the corporation, we want to know who is using which computer, and do some phone routing based upon this information. When a user log's uses it's account to login, the phone on the...
0
by: ShailShin | last post by:
Hi All, Developing an VB App for Login and logout tracking. In App Form there are two buttons login and logout. When user click on login the loginName, LoginTime and LoginDate get stored in...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
3
by: kashok | last post by:
hi, how to track users login/logout time on our site and store it in database Thank U Ashok
5
by: samatair | last post by:
I am using sessions to maintain login/logout status. I update the table when a user logs in and logs out. But some users don't logout. How to automatically log them out and update the status. I had...
1
by: naveenkongati | last post by:
Hi, My application is designed under MVC2 architecture which includes JSP,Servlet,DAO and bean. In this application i am tracking a user login details into a table. When user logs out i am...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.