书签每分钟左右刷新页面,这样我就不会在午餐时丢失会话数据
我刚刚将大量数据输入到我正在测试的网站中。我不想再进去了,但想去吃午饭,当我回来时,会话已经过期了。
小书签会很方便(因为这种情况经常发生),可以每隔一分钟左右刷新页面。
有什么想法吗?
谢谢。
I've just entered a load of data into a site that I'm testing. I don't want to enter it again, but want to go for lunch, and the session will have expired by the time I get back.
A bookmarklet would be handy (as this situation occurs often) to keep refreshing the page, every minute or so.
Any ideas?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个小书签每 5 分钟重新加载一次页面,几乎肯定会保持会话处于活动状态,就像您刚刚打开一个新选项卡一样;诀窍是在单独的窗口/选项卡中重新加载页面,如下所示。
您必须禁用弹出窗口阻止程序/允许打开第一个窗口。显然只创建了一个新窗口,否则这将是一个糟糕的解决方案。
要测试这一点,只需将 1000*60*5 替换为 1000*5(5 秒)之类的值。
用户的用例并不真正需要它,但如果其他人想避免关闭页面,您可以使用此书签来停止刷新。
This bookmarklet reloads the page every 5min, almost certainly keeping the session active as if you had just opened a new tab; the trick is to reload the page in a separate window/tab as follows.
You will have to disable your popup blocker / allow the first window to open. Obviously only one new window is created, else this would be a terrible solution.
To test this, merely replace 1000*60*5 with something like 1000*5 (5 seconds).
The user didn't really need it for his use case, but if someone else wants to avoid closing the page, you can just use this bookmarklet to stop the refreshing.