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

How to expire a login

I want to eliminate multiple logins by expiring an existing login whenever a
user logs in.
This, I was thinking, will eliminate multiple logins as well as cater for
browser crashes.

So to put this into effect I have to find any current
sessions(authcookies?), if they exist, that user id might have open and
expire them during then login process.

Does anybody know how to do this? I am using
'FormsAuthentication.SetAuthCookie'.

Or maybe there is a better way?

Thanks in advance

Alfred
Nov 19 '05 #1
4 1311
Hello Alfred,

You could do FormsAuthentication.SignOut().

--
Matt Berther
http://www.mattberther.com
I want to eliminate multiple logins by expiring an existing login
whenever a
user logs in.
This, I was thinking, will eliminate multiple logins as well as cater
for
browser crashes.
So to put this into effect I have to find any current
sessions(authcookies?), if they exist, that user id might have open
and expire them during then login process.

Does anybody know how to do this? I am using
'FormsAuthentication.SetAuthCookie'.
Or maybe there is a better way?

Thanks in advance

Alfred

Nov 19 '05 #2
Thanks, but the problem is that the new login is under a different session.
SignOut only removes the token from the current session.

Alfred

"Matt Berther" <mb******@hotmail.com> wrote in message
news:67***********************@news.microsoft.com. ..
Hello Alfred,

You could do FormsAuthentication.SignOut().

--
Matt Berther
http://www.mattberther.com
I want to eliminate multiple logins by expiring an existing login
whenever a
user logs in.
This, I was thinking, will eliminate multiple logins as well as cater
for
browser crashes.
So to put this into effect I have to find any current
sessions(authcookies?), if they exist, that user id might have open
and expire them during then login process.

Does anybody know how to do this? I am using
'FormsAuthentication.SetAuthCookie'.
Or maybe there is a better way?

Thanks in advance

Alfred


Nov 19 '05 #3
Hi Alfred,

Thanks for your posting. As for the question you mentioned, I think we
haven't any direct means to drop all the currently existing logined user's
Auth tokens (auth cookie) since the cookie are stored on the client side
and the serverside has no of them until a client request coming to the
server. And currently, one approach is that we maintain a lookup table at
serverside which contains the list of the logined users, and when each
request comming, before the page code execute, maybe you can try do this in
a application event such as (begin request or authenticate request) , we
check the lookup table, if dosn't in the table, use the
FormsAuthentication.Signout to logout the user.

Thanks

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4
One way that you could potentially do this is to store the SessionID in
a global(application) hashtable or object with the userid as a key, and
check that on each page to make sure that the current sessionid is the
right one, otherwise overwrite it on the new login.

That would log the original user out, effectively.. you could put code
to abandon their old session.

It's not a great solution, but it would work.

Lowell

Alfred Tascon wrote:
Thanks, but the problem is that the new login is under a different session.
SignOut only removes the token from the current session.

Alfred

"Matt Berther" <mb******@hotmail.com> wrote in message
news:67***********************@news.microsoft.com. ..
Hello Alfred,

You could do FormsAuthentication.SignOut().

--
Matt Berther
http://www.mattberther.com

I want to eliminate multiple logins by expiring an existing login
whenever a
user logs in.
This, I was thinking, will eliminate multiple logins as well as cater
for
browser crashes.
So to put this into effect I have to find any current
sessions(authcookies?), if they exist, that user id might have open
and expire them during then login process.

Does anybody know how to do this? I am using
'FormsAuthentication.SetAuthCookie'.
Or maybe there is a better way?

Thanks in advance

Alfred



Nov 19 '05 #5

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

Similar topics

4
by: Ryan Hubbard | last post by:
I would like to limit multiple logins for a user. How and when does the session id expire? Can I set it so after x minutes of inactivity it would expire. How do I check if session id exists? If...
1
by: HorseGeek | last post by:
I have three servers: Server1, Server2, and Server3. There is a login cookie does not expire for SOME users on Server2. Ironically, the login cookie expires correctly for ALL users on the...
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... ...
13
by: Veeresh | last post by:
I am using .Net 1.1. How to expire an .aspx page? I think I have to use HttpCachePolicy class for this. But not sure how to use and where to this code to work. Is it in Page_load event. Thanks...
2
by: karunakar | last post by:
Hi All I dont want to expire the applicatoion Once login the application i dont want to expire the application Presently iam doing using cookies this is not working fine Please help me out ...
1
by: gvrajkumar | last post by:
Hi Popup window is opened and after some time session has expired. After session expire, if the user tries to make any actions on the popup page the user is redirected to login.jsp page. What...
0
by: aspineux | last post by:
setacl and getacl look to be already "Cyrus" specific (according the doc), why not to extend imaplib a little bit more ? Here are some code I wrote and tested to support cyrus "expire" that...
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: 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
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
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
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.