Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mahesh Narke
Liferay:Add cookie from portlet
November 11, 2013 12:12 AM
Answer

Mahesh Narke

Rank: Junior Member

Posts: 77

Join Date: October 11, 2013

Recent Posts

I trying to add cookie from portlet:


HttpServletResponse response=PortalUtil.getHttpServletResponse(renderResponse);
Cookie cookie=new Cookie("abc","123");
response.addCookie(cookie);




But when i am trying to print value for this cookie i am not able to find this cookie. Can anyone suggest me the solution for this?
Mahesh Narke
RE: Liferay:Add cookie from portlet
November 11, 2013 2:25 AM
Answer

Mahesh Narke

Rank: Junior Member

Posts: 77

Join Date: October 11, 2013

Recent Posts

i also tried
Cookie cookie = new Cookie("name", value);

renderResponse.addProperty(cookie);


but again i am not getting cookie
venka reddy
RE: Liferay:Add cookie from portlet
November 11, 2013 2:39 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

following link can be useful

http://liferaytutorial.blogspot.in/2013/11/adding-cookies-in-javaliferay.html