Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0
Hi,
 
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,
 
Regards,
Nagaraju.N
Posted 14-Dec-10 21:01pm
Edited 14-Dec-10 22:04pm
v3
Comments
Arindam Tewary at 15-Dec-10 3:32am
   
what type of application you have been referring to? Is that web or windows ?
Abdul Quader Mamun at 15-Dec-10 3:40am
   
Is this windows application?
Rate this: bad
good
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.
  Permalink  
Rate this: bad
good
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.
  Permalink  
Comments
senguptaamlan at 15-Dec-10 4:38am
   
Application_End don't file when a user closes browser.
Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 643
1 OriginalGriff 550
2 CPallini 415
3 George Jonsson 231
4 ChauhanAjay 150
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,032
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2014
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