473,396 Members | 1,866 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.

Session + Client Machine Restart Issue

33
Hi All, Hope You Are Fine :), I Got A situation Here....

When a user log's with his login id on my web application i set a tag in the DB to "1" so that no other user with the same id can login from any other machine with the same login id, when he logs out i reset the tag to "0".

But the problem here occurs is that if a user gets logged in & then his machine suddenly restarts the tag in DB remains "1" & hence from the next time he can't be able to re login.

Is there a way to solve the issue.... or a better way how not to allow two users to login with the same login id at the same time.

Thanks
Nov 26 '10 #1
6 1676
Frinavale
9,735 Expert Mod 8TB
Add a Global.asax file to your application. In that file you will be able to implement a method that handles the Session_End Event. (Only if you are using InProc Session...InProc is the default configuration for Session).

-Frinny
Nov 26 '10 #2
sanndeb
33
Does Session_End event catch machine restart or power off?
Nov 27 '10 #3
Frinavale
9,735 Expert Mod 8TB
No, it doesn't.
But the Application_Load event is executed when the web application is first loaded after a reboot...you can do your clearing at that point too.
Nov 29 '10 #4
sanndeb
33
But I was talking about restart of a client machine without using the proper logout, then what's the way to log the user out forcefully, i.e change a tag in DB that the user is logged out?
Nov 29 '10 #5
Frinavale
9,735 Expert Mod 8TB
If the client's computer reboots, then their Session will time out after 20 minutes (by default) and the Session_Timeout event is fired....So if the user comes back within 20 minutes and their cookies have been cleared, there is a chance that there will be about 20 minutes of waiting before they can log in again....if cookies weren't cleared, then they will still be "logged in".



-Frinny
Nov 29 '10 #6
Just keep the user identification in the session variable as a key. check for the key during every login and allow user if key is null else skip saying user already online..when user is already online, key exists and parallel login is prevented. This way even if your client machine exits in a haphazard manner..session is cleared and user is allowed login again.
Dec 8 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Marcus | last post by:
I have created a DTS package that pulls data in from Oracle into SQL Server. When I run it directly on the server (from Enterprise Manager), it works fine. When I run it from Enterprise Manager on...
3
by: Prasad Patil | last post by:
Hi, I have a webform, The link on the webform should call the exe program installed on the client machine when the user click the link on the webform. It should run the exe installed on the...
1
by: luciano | last post by:
Hi everyone, I want to create a application and a webservice, application connect to web service to activate, web sevice will create a certificate to authenticate this client, for each...
1
by: Raj | last post by:
Hi, I want to detect a s/w installed on the browser client machine and change my asp.net application's behavior according to that. I already have the javascript to detect the s/w installed on the...
0
by: Bill Nguyen | last post by:
I applied SP2 and added CrystalReports10_NET_EmbeddedReporting.msm to the setup and rebuilt the package. The installation at a test client was successful. The package did require a restart of the...
0
by: Ankur Tyagi via .NET 247 | last post by:
Hey, I have been trying to actually explore the various certificates available across all the platforms. I had started with Microsoft Certiying Authority of the microsoft. I had actually created a...
4
by: JaiPrakash Sharma | last post by:
Hi All, I have a question regarding Using a Windows based UserControl or Applications on the Web. My question is Must be the .NET Framework to be Installed on Client Machine, When any...
0
by: Chandruit | last post by:
Dear Friend, I have developed Windows Base .NET application through C#, now I have deployed in my Main Server Win2003. The Remote clients are connected the Server application through WTS. Here I...
5
by: rohitkumar | last post by:
I am trying to build a web application which can execute dos print command on the client machine. This application will read a file stored in server and it will create a folder on client machine...
1
by: Gopala Raghavan | last post by:
I have compiled the sample application 'Localdata' in Visual Studio 2005 and published it IIS 5. The data files are located on the C Drive of this machine which is called DEV15. When I run it from my...
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:
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
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
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
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...
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.