i need crete cookie when user login in portal
i’m use a “event handle”
event type = login
listener type= synchronous
HttpServletRequest request = PortalServlet.getCurrentRequest();
MWSLoginEvent event = (MWSLoginEvent)getEvent();
Action action = event.getAction();
if (action == MWSLoginEvent.Action.ACTION_LOGIN_SCRIPT_DONE) {
Cookie cookie = null;
Cookie[] cookies = request.getCookies();
if (cookies != null){
for (int i = 0; i < cookies.length; i++){
if (cookies[i].getName().equals("CookieSession")){
cookie = cookies[i];
}
}
}
if (cookie == null){
cookie= new Cookie ("CookieSession","aaaa");
response.addCookie(cookie) ;
}
}
but resquest and response are null. PortalServlet.getCurrentRequest() not work for me…