java - jersey adding a cookie and then doing a redirect -
i trying set cookie below domain , doing 307 redirect. however, the cookie doesnt seem getting set , not present on subsequent requests browser. missing?
import javax.ws.rs.*; import javax.ws.rs.core.*; public response getuserinfo() { try { return response.temporaryredirect(new java.net.uri(this.loginresponseredirecturl)) .cookie(new newcookie("xxxx", "value", "/", ".test.net", 1, null, 24*60*60, false )) .build(); } catch(exception e) { system.out.println("redirect exception " + e.getmessage()); } }
you might send cookie server client reject in order see if appens can enable logging
in jersey 1.x go in web.xml , add :
<init-param> <param-name>com.sun.jersey.spi.container.containerresponsefilters</param-name> <param-value>com.sun.jersey.api.container.filter.loggingfilter</param-value> </init-param> <init-param> <param-name>com.sun.jersey.spi.container.containerrequestfilters</param-name> <param-value>com.sun.jersey.api.container.filter.loggingfilter</param-value> </init-param>
give me feedback in order solve that.
Comments
Post a Comment