I am developing a simple java ee application with front end in angular 4.
with login(url = '/login'), i am setting user in http session like below :
SessionUser user = userService.authenticateUser(email,password);
request.getSession().setAttribute('SESSIONUSER', user);
Also, I have written an Interceptor, which is intercepting each request (except login) and allow only if user is logged in i.e i am checking below :
if(null != request.getsession().getAttribute("SESSIONUSER"))
return true;
else
return false;
now after login success my dashboard is loading, on Loading of my dashboard i am making an another call to server to get some dashboard setting (url = '/dash-setting')
but, in my interceptor i am getting session as null , Hence interceptor not allowing to pass my next requests.
(note - i am getting JSESSIONID in response of login but i am not using it in any request, I hope this is not the issue? if yes then please let me know how to add this in next requests)