Skip to content

Can Cognito cookies be used for Authenticating user while trying to login via public SPA client?

0

Hi Team, I would like to know how cognito cookies can be used to keep the user logged in for 1 hour without depending on different JWT for session management from public SPA client. On which domain this cookie is shared and on which cognito end point and what is the name of cookie (is this 'cognito' as given in official AWS documentation ) ? Does it get generated again on each refresh of cognito managed login ?

asked a month ago102 views

1 Answer
0
Accepted Answer

Yes, Cognito cookies can be used to maintain user sessions in a public SPA client, but they are tied to the Cognito Hosted UI domain and are not a replacement for JWT-based session management. The cookies are set by Cognito managed login endpoints and are scoped to the custom domain (or the default *.auth.<region>.amazoncognito.com domain) of your user pool. They are automatically refreshed during login flows, but applications should still rely on the issued ID/Access/Refresh tokens for session handling.

https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-how-to-authenticate.html

EXPERT

answered a month ago

  • Thanks for the information. Does AWS has any recommendation for storing tokens for clients that are registered as public SPA clients?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.