GWT and JSESSIONID

1,190 views
Skip to first unread message

Hermod Opstvedt

unread,
Feb 21, 2008, 2:38:09 PM2/21/08
to Google-We...@googlegroups.com
Hi

There has been a lot of discussions regarding authentication and the use of JSESSIONID. First of all it is important to note that if you serve your gwt application through say an Apache HTTP server which in turn uses Tomcat as its servletengine via JK_MOD, you will not get a JSESSIONID as a header cookie when doing rpc requests to the server. Can be verified by looking at the headers in firebug.

So the only way to get a JSESSIONID is to have the GWT .html page be served by the servlet engine. Next is getting the header cookie using String JSESSIONID=Cookies.getCookie("JSESSIONID"). Now send that as part of each RPC request to the server by altering your service so that: target.setServiceEndPoint(GWT.getModuleBaseUrl() + "yorservicename" + ";" + JSESSIONID). Now the server will associate your request with a given session that has a given authentication (and hence authorization level).

Hermod

Peter Blazejewicz

unread,
Feb 21, 2008, 4:10:32 PM2/21/08
to Google Web Toolkit
hi,
I believe there are many different ways to configure Apache web server
to support sessioning from Tomcat connector,
e.g:
http://forum.java.sun.com/thread.jspa?threadID=5127540&tstart=180

regards,
Peter

On Feb 21, 8:38 pm, "Hermod Opstvedt" <hermod.opstv...@gmail.com>
wrote:

Hermod Opstvedt

unread,
Feb 21, 2008, 4:58:15 PM2/21/08
to Google-We...@googlegroups.com
Hi

Which applies to a totally different scenario where one is not using mo_jk, but mod_proxy. If you manage to get a JSESSIONID (doing it the way I prescribed) it will go through using mo_jk. What I wanted to point out was that the initial request needs to go to the servletengine, not to the HTTP server. This because you at that time will get a JSESSIONID.

Hermod

-----Opprinnelig melding-----
Fra: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] På vegne av Peter Blazejewicz
Sendt: 21. februar 2008 22:11
Til: Google Web Toolkit
Emne: Re: GWT and JSESSIONID
Reply all
Reply to author
Forward
0 new messages