In my application authentication done by a third party service, that service generate a token cookie and save it on client side.
Problem: When user accessing the application, during accessing some user clear the site specific cookies in chrome browser and sometimes cookie session expired but there is no way to identify this in application. please suggest me how can I identify this that cookie is removed or expired.
Tried approach: I tried to get cookie by document.cookie but it's not returning that authentication cookie.
Your token cookie is httpOnly due to security reasons, because this kind of cookies are hidden to the code to prevent any third party lib to steal sessions in your application.
So you should not check if the cookie exists or not as a regular one, instead your identity service should provide you an endpoint where you could do a call (that will contain your httpOnly token cookie), and which will responde accordingly depending on the state of your token/session.