Wednesday, February 05, 2014

wicket session cookie path and nginx

i found that wicket was setting cookies something like this:

Set-Cookie:JSESSIONID=CK_iXXR-Sj11WxeJjPz2R8VI; path=

where the path wasn't set. if the page that set the cookie was in /foo/bar/MyPage then resources at /myservlet were not getting the cookie passed. this caused a problem when i deep linked users and the cookie was being set from a deeper path and not the home page. it looked like others had similar problems and couldn't find a setting in wicket so i looked to nginx to deal with it. the fix was quite simple:

 proxy_cookie_path '' /;

here's the page i used for reference: