触发用户登录会话 [英] Trigger User Login Sessions

查看:85
本文介绍了触发用户登录会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望触发会话超时和浏览器关闭事件作为用户注销事件,

有没有办法捕获此事件。

I want to trigger session time out and browser close event as a user log off event,
Is there way to capture this events.

推荐答案

您好Tkkf87,



我想从上面的评论帖中了解您的问题,



您可以在客户端添加 Javascript计时器在后台向服务器发送事件,计时器可以设置为20分钟(这是默认值)我相信IIS中的会话超时,或者您选择的任何其他值。



Javascript可以发送用户ID来跟踪,这可以是 session_id ,这可以是一种安全的做法。



这样服务器可以跟踪会话结束的用户,

您也可以使用此事件将一些数据返回给客户端,例如会话即将超时的通知,如果他想要保持连接,则单击您下注!你得到的照片......





干杯,

Edo
Hi Tkkf87,

I think I understand your question from the comments thread above,

You can add a Javascript timer on the client side that will send an event on the background to the server, the timer can be set to 20 minutes (which is the default session timeout in IIS I believe), or any other value of your choice.

The Javascript can send a user id to keep track, which can be the session_id, that could a safe practice.

This way the server can track it''s users that have the session ended,
you can also use this event to return some data to the client, like a notification that the session is about to time out and if he\she wants to stay connected then click "You Bet"! you get the picture ...


Cheers,
Edo


这篇关于触发用户登录会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆