On Mon, Oct 22, 2012 at 4:14 PM, Michael Joyner <michael@newsrx.com> wrote:
I injected a hackish fix. As this servlet is being deployed in multiple contexts, counting on the proxy stuff being set correctly is problematic. I prefer not counting on myself or other humans in making sure said proxy configs are set correctly everywhere.
On Monday, October 22, 2012 4:07:52 PM UTC-4, Abraham Lin wrote:Use the ProxyPassReverseCookieDomain and ProxyPassReverseCookiePath directives in your httpd config. Depending on how your virtual hosts are configured, you may want to make use of the environment variable interpolation.
Is there any reason these values cannot be set in the gwt RPC servlet? I can set these in the a 'standard' servlet using the previously referenced code, and I am at a loss as to why I can't set them for a GWT servlet also...
-Abraham
Here is my hackish fix for those curious:
/* (non-Javadoc)
* @see com.google.gwt.user.server.rpc.RemoteServiceServlet#processCall(java.lang.String)
*/
@Override
public String processCall(String payload) throws SerializationException {
fixSessionCookie();
return super.processCall(payload);
}
private void fixSessionCookie(){
String sessionId="";
sessionId=getThreadLocalRequest().getSession(true).getId();
Cookie sessionCookie=new Cookie("JSESSIONID", sessionId);
sessionCookie.setComment("API Session Tracking Cookie");
sessionCookie.setDomain(getThreadLocalRequest().getServerName());
sessionCookie.setPath("/");
sessionCookie.setSecure(false);
sessionCookie.setValue(sessionId);
sessionCookie.setMaxAge(-1);
System.err.println("session id: "+sessionCookie.getValue());
getThreadLocalResponse().addCookie(sessionCookie);
}
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment