title: Simple storage not persisting data between sessions
body: <p>I'm trying to use the simplestorage from my extension, but I can't retrieve values between browser sessions. Here's the thing: From my main code, I created a value this way:</p>
  
  <pre><code>var ss = require("sdk/simple-storage");
  ss.storage.foo = [{id:"bar1", properties:{a:"aaa", b:"bbb"}}]
  console.log(ss.storage.foo);
  </code></pre>
  
  <p>This is ok, I coud see the object through the log. But then I closed the browser, commented the "foo definition" (line 2) and the console log was "<code>undefined</code>".</p>
  
  <p>I know cfx run by default uses a fresh profile each time it runs, so simple storage won't persist from one run to the next. But I'm using </p>
  
  <pre><code>cfx -b firefox run --profiledir=$HOME/.mozilla/firefox/nightly.ext-dev
  </code></pre>
  
  <p>So I'm sure I'm using the same profile everytime.</p>
  
  <p>What could be happening? What am I missing? Any idea is welcome! Thanks in advance!</p>
  
  <blockquote>
    <p>Thanks to the answer of Notidart, I could discover that the problem was the file is saved when you close Firefox in the right way. When you just kill it through console, it's not persisting data.</p>
  </blockquote>