掲示板
Clearing the cookies Programatically
9年前 に venka reddy によって更新されました。
Clearing the cookies Programatically
Regular Member 投稿: 231 参加年月日: 11/03/23 最新の投稿
Hi,
I want to logout the user programmatically. so i tried to clear the cookies as shown below code but still user is logged.
Any Suggestions to clear the cookies? Is anything wrong in the code?
Cookie[] cookies = actionRequest.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
cookies.setValue("");
cookies.setPath("/");
cookies.setMaxAge(0);
actionResponse.addProperty(cookies);
}
}
I want to logout the user programmatically. so i tried to clear the cookies as shown below code but still user is logged.
Any Suggestions to clear the cookies? Is anything wrong in the code?
Cookie[] cookies = actionRequest.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
cookies.setValue("");
cookies.setPath("/");
cookies.setMaxAge(0);
actionResponse.addProperty(cookies);
}
}
9年前 に Archi Madhu によって更新されました。
RE: Clearing the cookies Programatically
Regular Member 投稿: 237 参加年月日: 08/03/25 最新の投稿
I think you need to end session as well.
Try to look at what liferay does when user clicks on log out and try to replicate it.
Try to look at what liferay does when user clicks on log out and try to replicate it.