V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
4ever911
V2EX  ›  Google

有没有方法不让浏览器 Session 失效?

  •  
  •   4ever911 · 305 天前 · 2297 次点击
    这是一个创建于 305 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我在 VPS 服务器上开着 chrome 登录了一些网站,一段时间不操作后,大部分的网站就需要重新扫码或者输入密码登录, 有没有办法让浏览器一次登录后,保持一直登录?

    有什么 chrome 插件之类的还是什么软件可以做到?

    10 条回复    2023-05-29 08:48:02 +08:00
    crysislinux
        1
    crysislinux  
       305 天前 via Android   ❤️ 1
    没办法,正规的实现都是服务端控制的,客户端只能让它提前失效,不能让它有效更久
    1423
        2
    1423  
       305 天前
    editthiscookie uncheck session + 改时间
    不一定管用,有些网站后台会过期
    crysislinux
        3
    crysislinux  
       305 天前 via Android   ❤️ 1
    不过很多网站有操作就可能续期。你搞个油猴脚本定期刷新好了。
    vitovan
        4
    vitovan  
       305 天前   ❤️ 1
    ```JavaScript
    // ==UserScript==
    // @name Reload All Pages Every 10 Seconds
    // @namespace http://tampermonkey.net/
    // @version 0.1
    // @description try to take over the world!
    // @author You
    // @match *://*/*
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';
    setTimeout(() => window.location.reload(), 10000);
    })();
    ```
    shinonome
        5
    shinonome  
       305 天前   ❤️ 1
    定期操作一下吧,后台保活之类的
    xiaowowo
        6
    xiaowowo  
       305 天前
    搞个定时刷新就可以了
    himly1
        7
    himly1  
       305 天前   ❤️ 1
    如果登录流程不太复杂的话,你可以用 Puppeteer 写段程序定时检测登录是否失效,如果失效了让程序自动登录就好了,然后开无头模式就行。
    awolf
        8
    awolf  
       305 天前
    有些定时刷可行,有些像 JWT 自己带超时的,还得重新续(需要有续的接口)
    laravel
        9
    laravel  
       305 天前
    定时刷新就可以了 https://chrome.google.com/webstore/search/auto%20refresh?hl=en-US&_feature=5stars 以前用腾讯云,动不动就退出,就用这个定时刷新,只要保证浏览器不关闭就可以了。
    tedzhou1221
        10
    tedzhou1221  
       304 天前
    Amazing Auto Refresh 这个插件。我一直在用。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   951 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:49 · PVG 05:49 · LAX 14:49 · JFK 17:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.