To my knowledge, all Servlet containers use "jsession" and they
assign it a random/unique value hence when you move across to different
webapps, they see an invalid/dead jsession ID and they realize that you
crossed webapps or you're trying to hack them and they reset your
cookie and give you a new jsession value. Why can't we do that?
Gili
On Sat, 29 Jan 2005 19:09:57 +0100, Juergen Donnerstag wrote:
>I think it is not an framework issue. It is more a question of what
>the servlet spec says and how servlet containers are configured by
>default.
>
>It might be that Tomcat uses a cookie name different that JSESSIONID.
>JSESSIONID is what Jetty is using. But that doesn't realy matter,
>because the major point is: does the container create a session id per
>servlet or per web apps.
>
>Cleaner? What is more simple than what I suggested. Just one line (and
>a comment) added.
>
>Juergen
>
>
>On Sat, 29 Jan 2005 12:55:06 -0500, Gili <[EMAIL PROTECTED]> wrote:
>>
>> Uh... I suggest finding out what other frameworks (like JSP) do
>> because last time I checked they all use "jsession" regardless of the
>> webapp and no problems occur, so why is that? There might be a cleaner
>> way to do this...
>>
>> Gili
>>
>> On Sat, 29 Jan 2005 18:39:39 +0100, Juergen Donnerstag wrote:
>>
>> >The required change is fairly simple. Make the wicket session
>> >attribute name unique per servlet. Instead of "session", it should be
>> >"session" + request.getServletPath()
>> >
>> >
>> > static HttpSession getSession(final Application application, final
>> >HttpServletRequest request)
>> > {
>> > // Get session, creating if it doesn't exist
>> > final javax.servlet.http.HttpSession httpServletSession =
>> >request.getSession(true);
>> >
>> > // The request session object is unique per web application,
>> >but wicket requires it
>> > // to be unique per servlet.
>> > final String sessionAttributeName = "session" +
>> >request.getServletPath();
>> >
>> > // Get Session abstraction from httpSession attribute
>> > HttpSession session =
>> >(HttpSession)httpServletSession.getAttribute(sessionAttributeName);
>> >
>> > if (session == null)
>> > {
>> > // Create session
>> > session = new HttpSession(application, httpServletSession);
>> >
>> > // Set the client Locale for this session
>> > session.setLocale(request.getLocale());
>> >
>> > // Attach to httpSession
>> > httpServletSession.setAttribute(sessionAttributeName, session);
>> > }
>> > else
>> > {
>> > // Reattach http servlet session
>> > session.httpServletSession = httpServletSession;
>> > }
>> >
>> > // Set the current session to the session we just retrieved
>> > Session.set(session);
>> >
>> > return session;
>> > }
>> >
>> >Juergen
>> >
>> >
>> >-------------------------------------------------------
>> >This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
>> >Tool for open source databases. Create drag-&-drop reports. Save time
>> >by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>> >Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>> >_______________________________________________
>> >Wicket-develop mailing list
>> >[email protected]
>> >https://lists.sourceforge.net/lists/listinfo/wicket-develop
>> >
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
>> Tool for open source databases. Create drag-&-drop reports. Save time
>> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>> _______________________________________________
>> Wicket-develop mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
>Tool for open source databases. Create drag-&-drop reports. Save time
>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>_______________________________________________
>Wicket-develop mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop