I have to log in to github.com very frequently. I was previously signed in on the browser, but some time in the future I'll visit GitHub again and I'm not signed in. How can I stay logged in to GitHub longer?

Looking at https://github.com/settings/security, I count 12 "user.login" events since the table starts on August 29, which averages to more than once per week needing to enter my password and TOTP code.

I have a lot of devices (multiple work and personal devices with different chrome profiles, 11 sessions at most, but more often about 6), but I hope that wouldn't cause the problem.

When I open the cookies for github.com, I can see the user_session cookies is only set for 15 days in the future -- is that how long the default GitHub login lasts? Maybe there's some knob to increase that? (I'd be willing to change my 2FA option to security key if that had made the login last at least 90 days.)

  • 4
    I also get this. It's so incredibly annoying. Some things are always logged in and others it just is constantly logging me out. Jul 7, 2021 at 1:49
  • Both github and stack overflow (linked to FB) are doing this to me. Some days are worse than others, but on a day it's bad, both are affected. No idea why. I don't know if it's just my work laptop, but I suspect it is. FB sends me these emails every time: "We noticed an unusual login from a device or location you don't usually use."
    – hepcat72
    Jan 11, 2022 at 21:51
  • 2
    This is incredibly annoying, especially the way that they also ask for 2FA every single time, even on the same computer. The made their site unusable in the false quest for security.
    – Antimony
    Feb 7, 2022 at 1:57
  • Possibly relevant: discussions.apple.com/thread/253248182?page=1
    – hepcat72
    Jan 3, 2023 at 20:48

1 Answer 1


In desktop Chrome:

  1. Inspect https://github.com page.
  2. Select Application tab.
  3. In the left bar under Storage, select Cookies, https://github.com
  4. Rightclick and edit the user_session and/or gist_user_session cookie's Expires / Max-Age date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.