title: Storing Session Variables in Lift Scala
body: <p>I am trying to store a session variable and then use it to modify the menu in Boot.scala.  Here is how I am storing the variable in a snippet:</p>
  
  <pre><code>object sessionUserType extends  SessionVar[String](null)
    def list (xhtml : NodeSeq) : NodeSeq = {
  
      Helpers.bind("sendTo", xhtml, 
                   "provider" -&gt; SHtml.link("/providerlogin",() =&gt; sessionUserType("provider"), Text("Provider")),
                   "student" -&gt; SHtml.link("/studentlogin",() =&gt; sessionUserType("student"), Text("Student")))
      }
  </code></pre>
  
  <p>Then in Boot.scala I do this:</p>
  
  <pre><code>val studentSessionType = If(() =&gt; S.getSessionAttribute("sessionUserType").open_!.equals("student"),
              "not a student session") 
  </code></pre>
  
  <p>I also tried to call the object by name (sessionUserType), but it can never find it, so I thought this might work, but I keep getting an empty box when i access it even though the actual binding and function get executed prior to the menu rendering.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p>Thanks</p>