SessionTimeoutFilter

uk.gov.hmrc.play.bootstrap.frontend.filters.SessionTimeoutFilter
See theSessionTimeoutFilter companion object
@Singleton
class SessionTimeoutFilter(config: SessionTimeoutFilterConfig, mkSessionId: () => String, clock: () => Instant)(implicit ec: ExecutionContext, val mat: Materializer) extends Filter

Filter that manipulates session data if 'ts' session field is older than configured timeout.

If the 'ts' has expired, we wipe the session, add a new SessionId and update the 'ts'. If the 'ts' doesn't exist, or is invalid, we just wipe the authToken.

This filter clears data on the incoming request, so that the controller does not receive any session information. It also changes the SET-COOKIE header for the outgoing request, so that the browser knows the session has expired.

A white-list of session values are omitted from this process.

Value parameters

config

an instance of SessionTimeoutFilterConfig representing the various configurable aspects of this class

mat

a Materializer instance for Play! to use when dealing with the underlying Akka streams

Attributes

Companion
object
Graph
Supertypes
trait Filter
trait EssentialFilter
class Object
trait Matchable
class Any

Members list

Value members

Constructors

@Inject
def this(mat: Materializer, config: SessionTimeoutFilterConfig, ec: ExecutionContext)

Concrete methods

override def apply(f: RequestHeader => Future[Result])(rh: RequestHeader): Future[Result]

Apply the filter, given the request header and a function to call the next operation.

Apply the filter, given the request header and a function to call the next operation.

Value parameters

f

A function to call the next operation. Call this to continue normally with the current request. You do not need to call this function if you want to generate a result in a different way.

rh

The RequestHeader.

Attributes

Definition Classes
Filter

Inherited methods

def apply(next: EssentialAction): EssentialAction

Attributes

Inherited from:
Filter
def asJava: EssentialFilter

Attributes

Inherited from:
EssentialFilter

Implicits

Implicits

implicit override val mat: Materializer