4

I'm wondering if there is an extension to automatically rewrite cookie expiration dates (either automatically for all sites or with a single-click button for the current site) for Google Chrome?

A lot of sites have cookies that expire a day/week/month from login, and for a personal PC with an encrypted hard drive, it can get a little annoying.

  • On Firefox there's "Cookie time". – Nemo Nov 13 '17 at 15:33
2

I'm not sure if there's any existing extension to modify the expiration dates of cookies on the client side, but it would be pointless for authentication cookies: The expiration date wouldn't provide any security if it wasn't stored on the server side.

The expiration date Chrome respects simply indicates The server won't accept this cookie anymore. It's useless now.. So even if an extension would modify that information, the server would just reject the cookie.

  • To the best of my knowledge, your answer is not correct. Servers set the expiry date for a cookie, but they are not responsible for expiring it. Only with cookies that are mapped to server-side session IDs is it possible for the server to know the cookie has expired. The client is 100% responsible for expiring the cookie. If the client sets the machine date back, you can always use a cookie that "should have been" expired, assuming no encrypted timestamp in the cookie contents. – Mahmoud Al-Qudsi Nov 20 '12 at 4:15
  • Servers [...] are not responsible for expiring it. Of course they are. The whole point of expiring an authentication cookie is to provide some security against cookie theft. Only the cookies on the devices you currently use have a non-expired cookie; all the cookies you might have left once on other devices are useless by now, so you don't have to worry about them anymore. Furthermore, if somebody does gain access to one of your cookies, it will only serve him for a limited amount of time. All these benefits would been nullified without server-side checks for expiration. – Dennis Nov 20 '12 at 10:46
  • @Dennis You could say that servers are indirectly responsible for expiring cookies... but Mahmoud is correct. Server sets the expiration date, but only the browser can do the actual expiring of the cookie. In other words, the browser will keep sending that cookie on any requests to the cookie's domain until the expiration date. The server can, of course, choose to overwrite the cookie with a new expiration date. – simmbot Nov 6 '14 at 0:40
  • @MahmoudAl-Qudsi "Only with cookies that are mapped to server-side session IDs is it possible for the server to know the cookie has expired ... assuming no encrypted timestamp in the cookie contents" - if the cookie is an authentication cookie, as specified by Dennis, and if isn't an encrypted / digitally-signed token (which would contain a timestamp, in any sane token scheme), then it must be mapped to a server-side session ID; that is necessary for the cookie to function as an authentication cookie. Dennis's answer here is correct, so long as we take it to be about auth cookies only. – Mark Amery Dec 1 '18 at 17:17
1

There is no extension for Chrome that will automatically rewrite the expiry date for incoming cookies at this time (that I have been able to find). This is theoretically possible, but I don't know if the Chrome extension API grants access to modify cookies for all websites willy-nilly.

1

I used good extension for manipulating cookies: https://chrome.google.com/webstore/detail/cookie-inspector/jgbbilmfbammlbbhmmgaagdkbkepnijn?hl=ru

Here you can change expiration date for any cookie. But if there is server-side check for expiration date, it won't work.

1

Looks the chrome extension Staying Alive for Google Chrome™ is what you are looking for.

Never Get Logged Out of any website due to idling! Many websites that require you to login has a session timeout. This means if you are not active for certain period of time your session will expire and when you click on a link or try to post a form next time you will be asked to login again.

To keep the session active you must keep clicking on some links or keep reloading pages.

This extension will do this for you in the background. Once logged in, the extension will keep requesting pages from the website at pre-determined intervals so your session will stay alive without you having to manually reload pages so you will not be kicked back to login form if you were away from you computer for long period of time.

Features:

  • Can have multiple background rules running at the same time, keeping active sessions for more that one website.

  • Can see the running background requests from the extension popup menu. Can see counter of requests made per site and live countdown until the next background request.

  • Some websites implement idle timeout in the browser with JavaScript. This extension can defeat these type of timeouts too by periodically reloading the current page in the browser tab.

  • Can cancel background request from the popup window.

  • Can have setup rules to not accept certain cookies by the background processes.

  • Can include extra header/value with background and reload requests

  • Option to play beep 10 seconds before page reload.

  • Option to disable power-saving mode to prevent computer from hibernating while background requests are running.

=============================== This is an Open Source project!

The source code of this extension is released under the MIT Open Source license and available on github https://github.com/snytkine/staying_alive

I hope other extension developers will find this project helpful when developing their own extensions.

-1

Chrome configuration

I'm not sure what you'd like to do here and which cookies you'd like to expire, but you can configure Cookie exceptions in Chrome by setting cookies of individual domains to:

  1. Clear on exit - every time you reopen browser and go to the same site, no are present; best for web shopping sites because some of them tend to adjust prices based on your previous views (usually raising a little so you're more willing to buy thinking the price is going to rise)
  2. Block - completely blocks cookies for particular domains
  3. Allow - normal behaviour that is here because you can have global settings and then set exceptions; if you'd have global block, you could allow individual domain cookies;

In Chrome v21 just go to:

Wrench (main menu) >
  Settings >
    Show advanced settings >
      Content settings... >
        Cookies -> Manage exceptions...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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