Reputation: 1025
In Liferay, I'm using session variables for InterPortlet Communication.
PortletSession psession = request.getPortletSession();
String userId = (String) psession.getAttribute("userId", PortletSession.APPLICATION_SCOPE);
After use of this variable, I want to destroy it.
How to destroy, scrap the session variables in liferay?
Upvotes: 1
Views: 559
Reputation: 4210
Use removeAttribute method of PortletSession. It will remove attribute from session.
In your case psession.removeAttribute("userId");
This is applicable to request and session attributes also.
Upvotes: 1