1
votes

In play 2.1 apps each user has it own Http.Context.current()? Or Http.Context.current() is the same for all users?

1

1 Answers

2
votes

Looking at the source code shows that the context holds the http request, the http response to that request, the session scope and the flash scope.

  • the request and response are not unique the current context -- they are set out in the routes file and chosen through the model/controller logic
  • the session scope is unique to that session -- that user during that login,
  • the flash scope is unique to that request -- it gets emptied on the next request

Play wraps all of that up and gives it a unique id. So the context would be specific to that single action, with parts that are constant to that user, and parts you can count on being constant across all users.