Project

General

Profile

Bug #3891

How to set cookie value with redirect page

Added by Chandana Kumara about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
03/13/2015
Due date:
% Done:

0%

Estimated time:

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

Also available in: Atom PDF