Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable http sessions with unfiltered-jetty #289

Open
sadr0b0t opened this issue Jan 26, 2015 · 0 comments
Open

Enable http sessions with unfiltered-jetty #289

sadr0b0t opened this issue Jan 26, 2015 · 0 comments

Comments

@sadr0b0t
Copy link

https://github.com/unfiltered/unfiltered/blob/0.8.4/jetty/src/main/scala/contexts.scala#L25-L29
changed single line in contexts.scala:

   val ctx = new ServletContextHandler(parent, path, false, false)

to

   val ctx = new ServletContextHandler(parent, path, true, false)

This sets ServletContextHandler constructor parameter sessions to true

http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/servlet/ServletContextHandler.html

ServletContextHandler(HandlerContainer parent, String contextPath, boolean sessions, boolean security)

Now I have sessions working with jetty like:

println("session id:" + req.underlying.getSession.getId)

session id:1v6stys8pjmdqfjm3vxtzfohr

Session id is required for example for form-based authentication.

a bit more info here: https://groups.google.com/forum/#!topic/unfiltered-scala/AyZVS2_4XFQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant