Click here to Skip to main content
15,883,948 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
while login isconnected will be set to 1 and logout isconnected will become 0 but login time itself closing browser isconnected remains 1 . i have a checking based on Isconnected For mutiple system login using a particular username ..

What I have tried:

Can't reset Isconnected while browser close will happen
Posted
Updated 18-May-17 0:50am
Comments
F-ES Sitecore 18-May-17 6:55am    
Please don't repost questions, the answers won't change

https://www.codeproject.com/Questions/1187870/Call-Csharp-method-from-js

Correct, you cannot do it accurately. You can use the WindowEventHandlers.onunload - Web APIs | MDN[^] and possibly get enough of what you need. Generally speaking it should not matter when or who is logged into a web app so you may consider rethinking what it is you are trying to accomplish.
 
Share this answer
 
Comments
Member 11781455 18-May-17 6:54am    
Actually i need solution like the below

Issue-2: After Closing the Browser & Login again, alert is showing as "Already Logged In"

Precondition: Configuration to be set as Single instance enable in "Password Policy Configuration"

Steps:

1. Login to Application

2. Close the Browser without Logging out

3. Open the application in browser

4. Select the Company in Login screen

5. Enter the Username

6. Enter the Password & try to Login again

Actual Result: Showing alert as "This user is already logged into this application from another location. If you are continuing with your login any data used by the login may be lost. Do you want to continue? "

Expected Result: Should allow to Login to application even if the Browser is closed without logging out.



Issue-3: If the session is expired & then try to Login, alert is showing as "Already Logged In"

Precondition: Configuration to be set as Single instance enable in "Password Policy Configuration"

Steps:

1. Login to Application

2. Do not do any transaction for 20 min/ Keep it idle for 20 min

3. Open the application in browser

4. Select the Company in Login screen

5. Enter the Username

6. Enter the Password & try to Login again

Actual Result: Showing alert as "This user is already logged into this application from another location. If you are continuing with your login any data used by the login may be lost. Do you want to continue? "

Expected Result: Should allow to Login to application even if the session is expired before logging out.
ZurdoDev 18-May-17 6:56am    
OK, so when they login check your flag and warn them. You'll also want to timestamp it because if their browser crashes or some of many other issues happens you won't be able to catch the logout and you'll want to reset your flag after some time passes.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900