title: Variables get reset after redirection [SCALA-PLAY]
body: <p>I am new to play framework. 
  In the given code invoking /connect get connected to salesforce and redirects to /getObjects, but after redirection salesforce connection variable "x" gets null again.</p>
  
  <pre><code>package controllers
  
  import play.api.mvc.{Action, Controller}
  
  class ApplicationController extends Controller {
    var x:connectBase = null
    def connect(uname: String, pwd: String) = Action {
      val con = SalesForceDump(uname, pwd)
      con.connect
      if (!con.isConnected) {
        Ok("error")
      }
      else {
        x = connectBase(con)
        Ok("user:").withSession("connected" -&gt; uname)
        Redirect(routes.ApplicationController.getObjects)
        // Ok("done")
      }
    }
  
    def getObjects = Action { request =&gt;
      println(x.connection) // this gets null
      request.session.get("connected").map { user =&gt;
        println("Hello " + user)
        Ok(x.connection.getAllObjects.mkString(","))
      }.getOrElse {
        Unauthorized("Oops, you are not connected")
      }
    }
  }
  </code></pre>