Jan 22nd, 2013, 08:03 AM
Can I store/retrieve session data in a web app that uses Spring REST API in backend
I wish to use Spring to create a API(Web Service), and I also wish to store some critical elements of data as session variables. The Spring based API will be the backend, while I wish to use JS library like JQuery to make calls + receive data from the API.
Now some of the elements have to be stored in session-- for eg once a user has logged in to my web app, I wish to store his email ID + user ID as session variables- so that after logging in, he can access his user data via Jquery call to the Spring Based API (Now the Spring based API can check whenever it is invoked, and retrieve that user's user ID/email ID(which were previously stored as session variables at the time the user successfully logged in)-- and the API will throw an error if user has not logged in.
From what I understand, REST APIs are supposed to be stateless-- but in my use case I wish to store some data as session variables. Is it possible to store some variables as session data? How do I do that? Any guides/how-to's / tutorials would be very helpful.
Tags for this Thread