Skip to content

Commit

Permalink
Make the servlet session identifier configurable from LiftRules
Browse files Browse the repository at this point in the history
  • Loading branch information
farmdawgnation committed Aug 10, 2017
1 parent b5618ce commit 501d1d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
*/
@volatile var authentication: HttpAuthentication = NoAuthentication

/**
* A session identifier for [[net.liftweb.http.provider.servlet.HTTPServletSession]].
*
* Under most circumstances, you won't need to change this value. However, in some cases
* containers will be configured with backing datastores that don't play nice with the default
* value. In those cases you can change this string to get those working.
*/
@volatile var servletSessionIdentifier: String = "$lift_magic_session_thingy$"

/**
* A function that takes the HTTPSession and the contextPath as parameters
* and returns a LiftSession reference. This can be used in cases subclassing
Expand Down Expand Up @@ -2294,4 +2303,3 @@ trait FormVendor {
private object sessionForms extends SessionVar[Map[String, List[FormBuilderLocator[_]]]](Map())
private object requestForms extends SessionVar[Map[String, List[FormBuilderLocator[_]]]](Map())
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import net.liftweb.common._
import net.liftweb.util._

class HTTPServletSession(session: HttpSession) extends HTTPSession {
private val LiftMagicID = "$lift_magic_session_thingy$"
private[this] lazy val LiftMagicID = LiftRules.servletSessionIdentifier

def sessionId: String = session.getId

Expand Down Expand Up @@ -72,4 +72,3 @@ case class SessionToServletBridge(uniqueId: String) extends HttpSessionBindingLi
}

}

0 comments on commit 501d1d5

Please sign in to comment.