MozillaZine

How can I control when cookies expire?

Discussion of general topics about Mozilla Firefox
tanstaafl
Moderator

User avatar
 
Posts: 42799
Joined: July 30th, 2003, 5:06 pm

Post Posted February 16th, 2009, 4:36 am

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

Post Posted February 16th, 2009, 9:57 am

The CookieSafe extension includes a cookie editor. Might that work?

tanstaafl
Moderator

User avatar
 
Posts: 42799
Joined: July 30th, 2003, 5:06 pm

Post Posted February 16th, 2009, 10:21 am

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

Post Posted February 16th, 2009, 11:15 am

I only use it for controlling cookie permissions myself. I tried to get its cookie editor to work just now, unsuccessfully.

Anonymosity
 
Posts: 8438
Joined: May 7th, 2007, 12:07 pm

Post Posted February 16th, 2009, 1:05 pm

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.

FatJohn

User avatar
 
Posts: 3165
Joined: October 19th, 2007, 10:19 am

Post Posted February 16th, 2009, 2:22 pm

Perhaps try this extension https://addons.mozilla.org/en-US/firefox/addon/5817 (SQLite manager) to dive into cookies.sqlite.

tanstaafl
Moderator

User avatar
 
Posts: 42799
Joined: July 30th, 2003, 5:06 pm

Post Posted February 16th, 2009, 8:01 pm

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

Post Posted February 17th, 2009, 12:18 pm

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.

tanstaafl
Moderator

User avatar
 
Posts: 42799
Joined: July 30th, 2003, 5:06 pm

Post Posted February 17th, 2009, 12:44 pm

Thanks for the explanation.

Anonymosity
 
Posts: 8438
Joined: May 7th, 2007, 12:07 pm

Post Posted February 18th, 2009, 12:49 pm

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: 122
Joined: December 30th, 2004, 3:23 pm

Post Posted March 20th, 2017, 8:39 pm

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 48.0;
Mac OSX 10.6.8; 2.33 Ghz Intel Core 2 Duo

LIMPET235
Moderator

User avatar
 
Posts: 37306
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted March 21st, 2017, 1:48 am

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

Locking due to very old age.
Ancient Amateur Astronomer
Win-7-HP/IntelĀ® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-50.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
RadioYachting. Conficker Test. (Always choose the "Custom" Install.)

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 1 guest