Bug #3891
openHow to set cookie value with redirect page
0%
Description
I want to set cookie value before redirect the page and get that cookie value after redirect the page as following code.
Before Redirect:-
WApplication.getInstance().setCookie("product-save", "true", 1200);
WApplication.getInstance().redirect("products");
After redirect the page, retrive cookie from another page as follows:-
if(WApplication.getInstance().getEnvironment().getCookieValue("product-save")!=null && WApplication.getInstance().getEnvironment().getCookieValue("product-save").equals("true")){
result.bindWidget("MessageBox", MessageBar.showMessage("Save Succcessfully",this));
WApplication.getInstance().removeCookie("product-save");
}
But after redirect the page it can not retrive the "product-save" cookie value. Because not set the "product-save" value. Pls let me know how can I do this?
Thanks.
No data to display