I am looking for a persistent session manager which saves the session on file system (like PHP) that can be used with DropWizard. I see there is one Environment.getSessionHandler()
, but I see no documentation on it.
I could write my own but I am hoping for a cooked meal. Will the above SessionHandler is what I am looking for? And how to use that?
With dropwizard>0.7
environment.jersey().register(HttpSessionProvider.class);
environment.servlets().setSessionHandler(new SessionHandler());
And then use @Session
annotation in your resource classes.
DropWizard does not support sessions out of the box and based on posts by the author in google groups, they aren't planning on supporting it in the future either.
The only way currently would be for you to implement org.eclipse.jetty.server.session.SessionHandler
yourself or look for something that already exists and then call environment.setSessionHandler(...)
And in case you need this info, DW 0.6.2 uses Jetty 8.1.10
You can also checkout http://cosmo-opticon.net/blog/2013/1/23/session-based-security-in-dropwizard and see if you can reuse some of that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With