title: Playframework 2, Websockets and Session
body: <p>I understand that when dealing with websockets, I can't use session.  The playframework 2 websocket chat example adds the username into the url, but what if I have a user thats already loged in and I don't want to pass his username through the url, is there another way to get the users login credentials from within a websocket request?</p>
  
  <p>Here is what I have tried so far:
  Request Page from where I will connect to the socket:</p>
  
  <pre><code>public static Result index(){
      session("username", "mike")
      return ok(indexpage.render());
  }
  </code></pre>
  
  <p>Here is the Websocket part:</p>
  
  <pre><code>public static Websocket&lt;JsonNode&gt; chat(){
      System.out.println(session("username"));    
      ....all the websocket stuff
  }
  </code></pre>
  
  <p>All that I get printed out is a null
  What am i doing wrong?</p>