How can I control when cookies expire?

Discussion of general topics about Mozilla Firefox
Locked
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

How can I control when cookies expire?

Post by tanstaafl »

I've noticed that with http://www.mercurynews.com/ I always have to keep logging in because the cookies expire, even if I don't exit the browser after logging in. The cookies are mix of several session cookies , 1 cookie that expires in about 30 minutes, 1 in 6 months, 1 in 2 years, and and 1 in 29 years.

I have cookies disabled in Firefox 3.0.6, with exceptions created for all of the web sites I want cookies for. I'm not running a software firewall , security suite, anti-malware program or using a proxy. The free Avast 4.8 anti-virus program is running a "web shield" provider but that doesn't know about cookies. The problem also occurs if I run Firefox in safe mode. I don't have cookie problems with other web sites.

I found a Add N Edit Cookies 0.2.1.3 extension and used it to edit the cookie that expired in 30 minutes and told it to save it, but after exiting and restarting Firefox the cookie reverted to its old value and I had to sign in again. Looking at the mozilla addons web page I notice "The version for FF3 has a bug. When the option "Accept third-party cookies" is disabled "Add N Edit Cookies" doesn't work.".

I uninstalled it and tried Firecookie 0.7. It requires Firebug so I also installed Firebug 1.3.2. However, options is grayed out in both of the addons and tools -> firebug -> inspect element-> cookies says "cookies panel is disabled".

I looked in both http://www.softwareishard.com/blog/firecookie/ and http://getfirebug.com/ and didn't spot anything about how to enable the cookies panel. Eventually I found a Software is hard blog entry that describes how to enable the cookie panel. I did that, however even though the list box claims the cookies panel is enabled I still get the same error message.

I might be able to work around this by enabling cookies in tools -> option, but I want to rely upon the exceptions. I don't want to switch to having Firefox remember passwords.

I'm running Firefox 3.0.6 from an account with admin privileges under Vista Home Premium SP1. Suggestions?
Alan Baxter
Posts: 4419
Joined: May 30th, 2005, 2:01 pm
Location: Colorado, USA

Re: How can I control when cookies expire?

Post by Alan Baxter »

The CookieSafe extension includes a cookie editor. Might that work?
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: How can I control when cookies expire?

Post by tanstaafl »

It doesn't appear to provide a way to edit when a cookie expires. It seems to focus on just controlling cookie permissions.
Alan Baxter
Posts: 4419
Joined: May 30th, 2005, 2:01 pm
Location: Colorado, USA

Re: How can I control when cookies expire?

Post by Alan Baxter »

I only use it for controlling cookie permissions myself. I tried to get its cookie editor to work just now, unsuccessfully.
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: How can I control when cookies expire?

Post by Anonymosity »

You would have to edit the cookie in such a way as to change the expiry date to a later date. You would need an editor that can make sense of the data in the cookie, which is not in human-readable form as it is stored.
User avatar
FatJohn
Posts: 3165
Joined: October 19th, 2007, 10:19 am

Re: How can I control when cookies expire?

Post by FatJohn »

Perhaps try this extension https://addons.mozilla.org/en-US/firefox/addon/5817 (SQLite manager) to dive into cookies.sqlite.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: How can I control when cookies expire?

Post by tanstaafl »

I installed the SQLite manager and copied the expiry integer from one of the cookies that doesn't expire for several years to the cookie used for the user id (which expires in 30 minutes). It updated it and tools -> options -> privacy -> show cookies shows it has the desired expiration (Thursday, February 14, 2019 6:52:13 PM), but I still get prompted to login.

What am I overlooking?
Racer
Posts: 6108
Joined: November 18th, 2002, 11:07 am

Re: How can I control when cookies expire?

Post by Racer »

If they have server-sessions, then there is nothing you can do (to the cookies) to keep your session alive. The server creates the session (with its own expiration), then sends a cookie to tie the browser-session to the server-session. However, once the server-side session expires, having a valid cookie won't do any good since it is pointing to an expired server-session. This is a fairly common way for web sites to work.

If the sessions actually are actually based on the cookie, then perhaps they have encoded the session expiration into the cookie value? I don't know.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: How can I control when cookies expire?

Post by tanstaafl »

Thanks for the explanation.
Anonymosity
Posts: 8779
Joined: May 7th, 2007, 12:07 pm

Re: How can I control when cookies expire?

Post by Anonymosity »

I just found out that cookie data can be edited with the Web Developer extension using the Cookie item in the toolbar. One can edit the expiry date that way. That will not help with expired server sessions, however.
Dick Guertin
Posts: 131
Joined: December 30th, 2004, 3:23 pm

Re: How can I control when cookies expire?

Post by Dick Guertin »

This may be a very late response, but I've found this problem was solved by making sure Cookies don't get cleared when Firefox exits. That's under the Preferences -> Privacy -> History > Use Custom Settings -> Clear history when Firefox closes -> Settings -> Cookies (unchecked).
Dick.Guertin; Firefox 56.0.2;
Mac OSX 10.10.6; 2.5 Ghz Intel Core I5
User avatar
LIMPET235
Moderator
Posts: 39936
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: How can I control when cookies expire?

Post by LIMPET235 »

Thank you, but as you noted, this thread is ancient.

Locking due to very old age.
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
Locked