Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2006, 12:41 AM
Authorized User
 
Join Date: Feb 2005
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to amitjoshipune Send a message via Yahoo to amitjoshipune
Default Prevent mulitiple logins in webgarden/farm senario


Hi,
I am working on asp.net C# and SQL server.
I am trying to creat login class. My problem is how to
prevent one user login multiple times simultaniously
.
I wish that only one use should be connected at a time.
only few previlaged people should be able to login multiple
times simultaniously like admin people.
I am going to use SQL server to store session state. Also
I have to deploy this website in Web garden/ web farm senario.

Please let me know urgently any solution.
Regards,
Amit Joshi
Pune, Maharashtra, India.



 
Old July 27th, 2006, 06:30 AM
Authorized User
 
Join Date: Apr 2006
Posts: 79
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via AIM to anujrathi Send a message via MSN to anujrathi Send a message via Yahoo to anujrathi
Default

Hi Amit,

For this purpose, use Application_AuthenticateRequest in global.asax.
when ever a user logged in & authenticate then store his/her user id (pls note not Session id bcoz it will different for every session, Session.SessionID).
So store user's unique userid in session variable & store it in a saperate database table. & Session_End subroutine remove the user's userid frm database table & also from Session variable.& whenever any user logged in check that this user id is present in the table or not.

So, what happens, u have the all current users that logged in in ur site. Now u can write any code to block the newer user or any other.

Regards,
Anuj Rathi
 
Old August 3rd, 2006, 02:18 AM
Authorized User
 
Join Date: Feb 2005
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to amitjoshipune Send a message via Yahoo to amitjoshipune
Default

I will try this solution. But if I use SQL server 2 store session state then Session_End does not get fired. So what to do in such cases?
Regards,
Amit Joshi
Pune, Maharashtra, India.

 
Old August 3rd, 2006, 07:11 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey why can't U a master table containing flags that gives the authentication level of each user .
if U have this status then in Ur code U can check for that and then start\restrict multiple sesssions right?
 
Old August 18th, 2006, 02:21 AM
Authorized User
 
Join Date: Feb 2005
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to amitjoshipune Send a message via Yahoo to amitjoshipune
Default

ok Antony,I will try this trick.and convey results.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Mulitiple/Nested IIF statements rohit_ghosh Access VBA 3 June 1st, 2007 10:44 AM
Passing Mulitiple pameters to a form query c_olinrb Access 3 January 19th, 2007 03:25 PM
mulitiple field query PLUS Durwood Edwards Classic ASP Databases 2 July 14th, 2005 10:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.