added Scala-based session authentication