Answers.Body: <p>No. Twig gets compiled into PHP and is run entirely on the server.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-28T17:41:39.437Z
Answers.LastActivityDate: 2017-08-28T21:48:09.630Z
Answers.LastEditDate: 2017-08-28T21:48:09.630Z
Answers.UserDisplayName: Marion Newlevant
Body: <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>
  
Tags: <templating><javascript>
Title: Local storage in Twig
ThreadText: # 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.
  
  
  ---
  
  