Session

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Session

thatismatt
Does unfiltered have any support for session? I know it isn't very "pure", but I want a convienient way of doing flash messages, I'm open to other "purer" suggestions if there are better ways of achieving what I want.

If using some form of session storage is the right way to go is the underlying HttpServlet's HttpSession exposed at all?

Thanks,
Matt
Reply | Threaded
Open this post in threaded view
|

Re: Session

n8han
Administrator
On 12/15/10 11:30 AM, thatismatt [via Databinder] wrote:
> Does unfiltered have any support for session? I know it isn't very
> "pure", but I want a convienient way of doing flash messages, I'm open
> to other "purer" suggestions if there are better ways of achieving
> what I want.

If you need user state, you need user state. :)

> If using some form of session storage is the right way to go is the
> underlying HttpServlet's HttpSession exposed at all?

Sessions are not enabled by default in the jetty Server builder, if you
are using that:
https://github.com/n8han/Unfiltered/blob/master/jetty/src/main/scala/servers.scala#L57

But once they are enabled, yes they're exposed. You have the full java
HttpServletRequest in unfiltered's HttpRequest#underlying

Nathan