超时会话的时间 [英] Time to timeout session

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

问题描述

有没有办法找出用户会话保持有效的时间(直到超时)?

Is there a way to find out how long the session of the user remains valid ( until it times-out)?

我想在页面上显示这次.

I would like to show this time on a page.

我知道如何设置超时,但找不到如何获取当前超时时间.

I know how to set the timeout, but could not find how to get the current time to time-out.

推荐答案

我认为您应该在浏览器中使用纯 JavaScript 跟踪时间,并在每次 Ajax/WebSocket 调用时重置.

I think you should track the time with plain JavaScript in the browser and reset with every Ajax/WebSocket call.

您无法在服务器上跟踪它,因为要检查您需要发出请求的时间,这将更新会话.

You cannot track it at the server because to check the time you need to make a request and this will renew the session.

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

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