Session in RESTful web service. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Session in RESTful web service.

Does anyone know how to maintain session in Java RESTful web service? I searched on Google but didn't find proper solution.

3rd Apr 2020, 11:26 AM
A͢J
A͢J - avatar
4 Answers
+ 6
AJ #Level 20 End Day You don't... or at least you shouldn't. RESTful services should never maintain session information on any server. The very nature of RESTful services is to allow each client call to run in isolation from any previous call. Access to a resource should be self contained within the individual request. Try searching on RESTful statelessness. That might provide more links on this architecture. Here is a link that might give you additional context. ---- https://en.wikipedia.org/wiki/Representational_state_transfer#Statelessness ---- https://www.infoq.com/articles/rest-introduction/ NOTE: Scroll down to the section titled: "Communicate statelessly" ---- https://stackoverflow.com/questions/3105296/if-rest-applications-are-supposed-to-be-stateless-how-do-you-manage-sessions NOTE: There are several good answers in this thread. ----
3rd Apr 2020, 5:36 PM
David Carroll
David Carroll - avatar
+ 1
David Carroll Thanks. I found the same answer on stackoverflow. But I will see shared link once.
3rd Apr 2020, 5:59 PM
A͢J
A͢J - avatar
0
David Carroll Do you know?
3rd Apr 2020, 11:26 AM
A͢J
A͢J - avatar
0
ekhlas Mohamed Abdallah Mohamed did you just copy David Carroll 's answer?
4th Apr 2020, 9:03 AM
Jared Bird
Jared Bird - avatar