I did it by calling handler's retrieveSession instead of portal's getApacheSession
retrieveSession
getApacheSession