Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I know this question is really old, but I had the same problem and never really found a complete sample of code (though the answers on this page pointed me in the right direction). HTH!</p> <pre><code>public static void ClearFirefoxCookies() { int procCount = Process.GetProcessesByName("firefox").Length; if (procCount &gt; 0) throw new ApplicationException(string.Format("There are {0} instances of Firefox still running", procCount)); try { using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + GetFirefoxCookiesFileName())) { conn.Open(); SQLiteCommand command = conn.CreateCommand(); command.CommandText = "delete from moz_cookies"; int count = command.ExecuteNonQuery(); } } catch (SQLiteException ex) { if (!(ex.ErrorCode == SQLiteErrorCode.Busy || ex.ErrorCode == SQLiteErrorCode.Locked)) throw new ApplicationException("The Firefox cookies.sqlite file is locked"); } } private static string GetFirefoxCookiesFileName() { string path = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData), @"Mozilla\Firefox\Profiles"); if (!System.IO.Directory.Exists(path)) throw new ApplicationException("Firefox profiles folder not found"); string[] fileNames = System.IO.Directory.GetFiles(path, "cookies.sqlite", System.IO.SearchOption.AllDirectories); if (fileNames.Length != 1 || !System.IO.File.Exists(fileNames[0])) throw new ApplicationException("Firefox cookies.sqlite file not found"); return fileNames[0]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload