Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362247

Summary: org.eclipse.jetty.server.session.AbstractSessionManager.setSessionPath() is missing
Product: [RT] Jetty Reporter: Bob Obringer <bobringer>
Component: documentationAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janb, jetty-inbox
Version: unspecified   
Target Milestone: 7.5.x   
Hardware: All   
OS: All   
Whiteboard:

Description Bob Obringer CLA 2011-10-27 18:29:44 EDT
Build Identifier: 8.0.4.v20111024

In 8.0.2, I'm able to call setSessionPath("/") to cause the session cookie to be set at the root.  8.0.4 removes setSessionPath()

Is that intentional?  Is there now another way to do it?  AFAIK, it was not deprecated, so... I'm stuck on 8.0.2 unless I want to extend and add setSessionPath() back in.

Reproducible: Always
Comment 1 Jan Bartel CLA 2011-10-27 19:16:28 EDT
Hi Bob,

This probably needs more documentation (I'll try and add something to the wiki), but in Servlet 3.0 api, there is now the javax.servlet.SessionCookieConfig class:


http://download.oracle.com/javaee/6/api/javax/servlet/SessionCookieConfig.html


You set domain, path etc up on that object instead. You retrieve it from your jetty SessionManager and then call its setters. From inside your servlet, you can also retrieve it from your ServletContext.
Comment 2 Jan Bartel CLA 2011-10-27 19:22:44 EDT
Shirley,

We need a page on the wiki about generally how to configure sessions, which should act as an introduction to the session clustering pages (just different specific ways of configuring sessions).

For jetty-8, there are new ways to configure the sessions, based on new Servlet Specification 3.0 apis (see below/above re SessionCookieConfiguration).

thanks
Jan
Comment 3 Bob Obringer CLA 2011-10-27 19:54:54 EDT
Jan,

Outstanding.  Thanks for the quick turnaround.

I've got this working already, couldn't have been easier.  Original code was:

JDBCSessionManager sessionManager = new JDBCSessionManager();
sessionManager.setSessionCookie("customcookiename");
sessionManager.setSessionPath("/"); 

---------------------

New code is:

JDBCSessionManager sessionManager = new JDBCSessionManager();
SessionCookieConfig sessionCookie = sessionManager.getSessionCookieConfig();
sessionCookie.setName("customcookiename");
sessionCookie.setPath("/");
Comment 4 Jan Bartel CLA 2013-11-08 00:09:00 EST
Updated jetty docs with servlet 3.0 api for session config.

Jan