Created
February 28, 2011 09:30
-
-
Save pr1001/847132 to your computer and use it in GitHub Desktop.
A Lift extended session model.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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