<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Problem Description</h3>
<p dir="auto">If I am not mistaken, the <code class="notranslate">cookie</code>, <code class="notranslate">localStorage</code>, <code class="notranslate">indexedDB</code> and resource cache of the programs based on Electron store in the following locations currently:</p>
<ul dir="auto">
<li>Windows: <code class="notranslate">C:\Users\&lt;userName&gt;\AppData\Roaming\&lt;productName&gt;</code></li>
<li>Linux: <code class="notranslate">/home/&lt;userName&gt;/.config/&lt;productName&gt;</code></li>
<li>OS X: <code class="notranslate">/Users/&lt;userName&gt;/Library/Application Support/&lt;productName&gt;</code></li>
</ul>
<p dir="auto">But when we use software in portable devices on different computers, we probably want to be able to freely specify the storage location to the portable device self, to <strong>use it anywhere continuously</strong>, or do not leave persistent traces in the temporary computer (maybe through in-memory session it's possible, but <code class="notranslate">loadExtension</code> is not supported in this case).</p>
<p dir="auto">In addition, we may also have multiple programs based on Electron <strong>developing</strong> (or just using). Even if we are careful to avoid duplication of names, we will encounter problems when different versions of the same software coexist.</p>
<h3 dir="auto">Proposed Solution</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="session.setPath(`&lt;customPath&gt;`);"><pre class="notranslate"><span class="pl-s1">session</span><span class="pl-kos">.</span><span class="pl-en">setPath</span><span class="pl-kos">(</span><span class="pl-s">`&lt;customPath&gt;`</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Alternatives Considered</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="session.fromPartition('persist:name', {
    path: `&lt;customPath&gt;`,
});"><pre class="notranslate"><span class="pl-s1">session</span><span class="pl-kos">.</span><span class="pl-en">fromPartition</span><span class="pl-kos">(</span><span class="pl-s">'persist:name'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">path</span>: <span class="pl-s">`&lt;customPath&gt;`</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="session.fromPartition('persist:&lt;customPath&gt;', {
    path: true,
});"><pre class="notranslate"><span class="pl-s1">session</span><span class="pl-kos">.</span><span class="pl-en">fromPartition</span><span class="pl-kos">(</span><span class="pl-s">'persist:&lt;customPath&gt;'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
    <span class="pl-c1">path</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">no</p>
<p dir="auto">In Electron 5, sandbox mode will no longer be experimental, and running with --enable-sandbox or --enable-mixed-sandbox will be the recommended way to use Electron. In Electron 6, --enable-mixed-sandbox will be on by default and the <code class="notranslate">sandbox</code> webPreferences option will be true by default.</p>
<p dir="auto">This is still an early-stage proposal, so definitely keen to hear any feedback or concerns people might have!</p>