Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7086557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:33:52+00:00 2026-05-28T07:33:52+00:00

I want to write an application which will create cookies for firefox. I want

  • 0

I want to write an application which will create cookies for firefox.
I want to create Client cookies so that firefox will send cookie content in HTTP request.
Similar to the win32 API InternetSetCookie()

Can you please guide on this ?

If you can point me to some code snippet or help, I will try to figure out from that.

This cookie needs to go to SQLITE database, but it seems from old questions that this database get locked if firefox is running. This locking is done in FF 3.5

Just want to confirm if this is the case with FF9 or do we have any API ?

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:33:52+00:00Added an answer on May 28, 2026 at 7:33 am

    On Firefox, you can write an add-on to achieve that. Take a look at the source code of the following add-ons. They provide features such as adding, deleting, editing cookies while Firefox is running. It seems they all work with Firefox 9.0.1 (latest stable).

    1. Cookie Manager+
    2. Advanced Cookie Manager
    3. Add N Edit Cookie
    4. Edit Cookie

    Edit:

    I am posting some cookie management code from the Evernote plugin’s MozillaCookieManagerImpl.js file. I think the code speaks for itself. Have a look below. It shows how to access cookies, set, get and remove them etc.

    Accessing Mozilla’s Cookie Management Interface

    Evernote.MozillaCookieManagerImpl = function MozillaCookieManagerImpl() {
    };
    Evernote.inherit(Evernote.MozillaCookieManagerImpl,
        Evernote.CookieManagerImpl, true);
    Evernote.MozillaCookieManagerImpl.isResponsibleFor = function(navigator) {
      var ua = navigator.userAgent.toLowerCase();
      return (ua.indexOf("firefox") >= 0 || ua.indexOf("thunderbird") >= 0 || ua
          .indexOf("shredder") >= 0);
    };
    
    
    Evernote.MozillaCookieManagerImpl.prototype.manager = null;
    Evernote.MozillaCookieManagerImpl.prototype._ios = null;
    Evernote.MozillaCookieManagerImpl.prototype._cookieSrv = null;
    Evernote.MozillaCookieManagerImpl.prototype._cookieManagerSrv = null;
    
    
    Evernote.MozillaCookieManagerImpl.prototype.getIOService = function() {
      if (this._ios == null) {
        this._ios = Components.classes["@mozilla.org/network/io-service;1"]
            .getService(Components.interfaces.nsIIOService);
      }
      return this._ios;
    };
    
    
    Evernote.MozillaCookieManagerImpl.prototype.getCookieService = function(
        force) {
      if (this._cookieSrv == null || force) {
        this._cookieSrv = Components.classes["@mozilla.org/cookieService;1"]
            .getService(Components.interfaces.nsICookieService);
      }
      return this._cookieSrv;
    };
    
    
    Evernote.MozillaCookieManagerImpl.prototype.getCookieManagerService = function(
        force) {
      if (this._cookieManagerSrv == null || force) {
        this._cookieManagerSrv = Components.classes["@mozilla.org/cookiemanager;1"]
            .getService(Components.interfaces.nsICookieManager);
      }
      return this._cookieManagerSrv;
    };
    

    Get Cookie

    Evernote.MozillaCookieManagerImpl.prototype.get = function(name, url) {
      var uri = this.getIOService().newURI(url, null, null);
      var cookieMgr = this.getCookieManagerService();
      if (cookieMgr) {
        for ( var e = cookieMgr.enumerator; e.hasMoreElements();) {
          var cookie = e.getNext().QueryInterface(Components.interfaces.nsICookie);
          if (cookie && cookie.host == uri.host && cookie.name == name) {
            return new Evernote.Cookie(cookie);
          }
        }
      }
      return null;
    };
    

    Set Cookie

    Evernote.MozillaCookieManagerImpl.prototype.set = function(cookie, url) {
      var uri = (typeof url == 'string') ? this.getIOService().newURI(url, null,
          null) : null;
      if (cookie instanceof Evernote.Cookie && typeof cookie.name == 'string'
          && cookie.name.length > 0) {
        this.getCookieService().setCookieString(uri, null,
            (cookie.name + "=" + cookie.value + ";"), null);
      }
    };
    

    Removie Cookie

    Evernote.MozillaCookieManagerImpl.prototype.remove = function(name, url) {
      var cookieMgr = this.getCookieManagerService();
      var urlParts = url.split("://", 2);
      var domain = (urlParts.length == 2) ? urlParts[1] : urlParts[0];
      urlParts = domain.split("/", 2);
      var path = (urlParts.length == 2) ? urlParts[1] : null;
      cookieMgr.remove(domain, name, path, false);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a new application that will use a DBMS. In the
I have written a application which runs in the background. I want to write
I want to write an application for Android devices that interacts with the surface
I am trying to create a Service for my application which will negotiate Bluetooth
I am interested whether I can write an application which will be able to
I want to write an application which has 2 EJBs. This application can run
I want to write a Swing application in Griffon but I am not sure
I want to write a C# application where it connects to a telnet server
I want to write a web application and want to use Ruby. I have
Hello I want write my own desktop sharing application in Java. The application should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.