samaswin
samaswin

Reputation: 384

How to identify the user is active in REST webservice java?

I am using a REST in Java and also I am using a token system for that. I need to know that, how we need to maintain the user session? Since REST is stateless we can not maintain user session, then how we need to find the active user in server side?

Upvotes: 0

Views: 93

Answers (1)

Opal
Opal

Reputation: 84784

After user is authorized and given access to the REST API a kind of a token or cookie should be returned with authorization response. The obtained token should be added all subsequent requests that need authorization. Using this token and assuming it's in one-to-one relationship with user you can easily identify the user.

Upvotes: 1

Related Questions