Skip to content

Instantly share code, notes, and snippets.

@pr1001
Created February 28, 2011 09:30
Show Gist options
  • Save pr1001/847132 to your computer and use it in GitHub Desktop.
Save pr1001/847132 to your computer and use it in GitHub Desktop.
A Lift extended session model.
import net.liftweb.mapper.{MetaProtoExtendedSession, ProtoExtendedSession}
import net.liftweb.common.Box
class Session extends ProtoExtendedSession[Session] {
def getSingleton = Session // what's the "meta" server
}
object Session extends Session with MetaProtoExtendedSession[Session] {
type UserType = User
override def dbTableName = "session" // define the DB table name
override def CookieName = "session_id"
def logUserIdIn(uid: String): Unit = User.logUserIdIn(uid)
def recoverUserId: Box[String] = User.currentUserId
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment