Click here to Skip to main content
13,053,399 members (59,478 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I have query that is:

I logged into the application with username and password and by mistaken i have closed the application instead of doing logging out.
when i again logging in it showing that

"User currently logged in".

how can i make the users logged out when they close the application.

This is in windows application.

Please help me,

Posted 14-Dec-10 21:01pm
Updated 14-Dec-10 22:04pm
Arindam Tewary 15-Dec-10 3:32am
what type of application you have been referring to? Is that web or windows ?
Abdul Quader Mamun 15-Dec-10 3:40am
Is this windows application?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Handle the main form FormClosing event[^] and auto log out there.

It may be worth your putting a timeout on logins, so they are only valid for a finite period, or issuing them with a session ID so that you can tell when a session reached an abnormal termination and the login shoudl have been invalidated.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If web application
Use sessions. Set it to null on Global file [Application_End]. Make sure that they are redirected to loggin page if session is null.
senguptaamlan 15-Dec-10 4:38am
Application_End don't file when a user closes browser.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

This would have happened when you had used tabbed-browser. In tabbed browser, but default the session is shared across and closing one tab does not clear the session. It is more of the browser setting related than application setting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100