Meaningless Drivel is fun!
The moose likes JSP and the fly likes glassfish auto-generates unwanted session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "glassfish auto-generates unwanted session" Watch "glassfish auto-generates unwanted session" New topic

glassfish auto-generates unwanted session

Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
Somehow glassfish seems to be generating a session for me, even without my explicit request.

I set up a small "dynamic web project" with eclipse, with a single jsp to show the problem, which consists in the http response containing a set-cookie for the jsessionid. I have no request.getSession() call or equivalent in my code. Can someone explain what is going on here and tell me how to disable it ?

jsp (disregard the fact that it uses scripplets and not EL/JSTL...)


sun-web.xml (generated by eclipse)


Thank you in advance.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

This is the default behavior for JSPs.
It's part of the JSP spec, not something specific to Glassfish.

Look at the <%@ page ...> directive documentation to see how to disable this.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
Thank you very much for your help Ben!
I agree. Here's the link:
subject: glassfish auto-generates unwanted session
It's not a secret anymore!