title: Firefox: session cookies not kept when browser is under remote control
body: <p>I am running Selenium automated tests in Firefox. The problem is that, when running tests on Firefox, the browser is open in "Browser is under remote control" mode and then the session cookies are not kept when the browser is closed.</p>
  
  <p>Here it is the ai_session cookie when I authenticate on my web app:
  <a href="https://i.stack.imgur.com/QnMHM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QnMHM.png" alt="Here it is the ai_session cookie when I authenticate on my web app."></a></p>
  
  <p>Here it is the ai_session cookie after restarting the browser using the same profile:
  <a href="https://i.stack.imgur.com/hlmns.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hlmns.png" alt="Here it is the ai_session cookie after restarting the browser."></a></p>
  
  <p>If I authenticate on my web app without using this "Browser is under remote control" mode, the ai_session cookie is kept as expected. It only is discarded when I am on that mode. </p>
  
  <p>Taking that into account:</p>
  
  <ol>
  <li>Is there a way to configure Firefox to keep session cookies even when running in the "Remote control" mode?</li>
  <li>When configuring Selenium WebDriver, is there some option that allows me to force the browser to keep the session cookies?</li>
  </ol>
  
  <p>Edit: I consider that the answers to <a href="https://stackoverflow.com/questions/47861813/how-can-i-reconnect-to-the-browser-opened-by-webdriver-with-selenium">How can I reconnect to the browser opened by webdriver with selenium?</a> do not fully address this question. My issue is mainly about the "Remote control" mode of Firefox. If I first authenticate on my app when Firefox is not on this "Remote control" mode, the session is kept and then I am able to use it when running my Selenium tests (so I do not need to log in again on each test). So I just need to know if it is possible to avoid using this mode when running automated tests or if it is possible to configure Firefox to keep sessions when using this mode.</p>