TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepak Veer
NA
13
7.9k
Limit only one session per user in ASP.NET mvc 4
Nov 29 2014 2:07 AM
I am working on one web application in which i want to make sure that website allow only one login per user at a time.
when user login i am updating table column islogged=1 when logoff i am updating islogged =0
but the problem is when user session timeout or if user closing browser i am unable to capture this events.i am using sqlserver state to store sessions so
Session_End event is not fired in this state .
it only works in InProc State. and also in browser close event i have tried onunload event. but this event is fired on tab closed also. not able to differentiate tab close and browser close.
i want only one concurrent user login. is there any other way to achieve this.
i am using this code to capture browser close event.
<body class="fixed-top" onclick="clicked=true;" onunload="CheckBrowser()">
<script type="text/javascript">
var clicked = false;
// var xmlHttp
// var browser = navigator.appName;
function CheckBrowser() {
debugger
// var browserClose = isUserClickedCloseButton();
if (clicked == false) {
$.ajax({
url: "@Url.Content("~/Account/LogOff")",
type: 'Post',
success: function (data) {
},
error: function () { alert("Error On Logut..."); }
});
}
Reply
Answers (
1
)
I want to know how to avoid space and enter key equal to a m
How to paste image in ASP.NET EDITOR Control