<p>No. Twig gets compiled into PHP and is run entirely on the server.</p>

CC BY-SA 3.0
2017-08-28T17:41:39.437Z
2017-08-28T21:48:09.630Z
2017-08-28T21:48:09.630Z
Marion Newlevant
<p>Quick question: Is it possible to access the browser's local storage in Twig?</p>

<p>In JavaScript you would do something like: </p>

<pre><code>localStorage.getItem('myItem');
</code></pre>

<p>Thanks!</p>

<templating><javascript>
Local storage in Twig
# Local storage in Twig

(Asked by: username_0 on 2017-08-28)

Quick question: Is it possible to access the browser's local storage in Twig?
In JavaScript you would do something like: 
localStorage.getItem('myItem');

Thanks!

**Tags:** templating, javascript

---

## 1 answers

### Answer by username_1 on 2017-08-28. Score: 6 | Accepted answer

No. Twig gets compiled into PHP and is run entirely on the server.


---

