title: Symfony get session variable inside of entity repository class
body: <p>I am trying to get a session variable inside of my Symfony2 entity repository class but not quite sure how to accomplish this task. </p>
  
  <p>Basically I am just doing this: </p>
  
  <pre><code>$this-&gt;get('session')-&gt;set('cart_id', $cartId);
  </code></pre>
  
  <p>Can someone please point me in the right direction. Thanks.</p>