-1

How Can I create session in Spring REST, Using Spring boot? I have ready application with REST APIs, now I just need to apply session in it. I have seen two ways for Spring REST and Spring Boot

http://docs.spring.io/spring-session/docs/current/reference/html5/guides/rest.html

and http://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot.html#boot-sample

So, I am using both then do I need to combine both ways? pls help

Sanjay Rabari
  • 2,091
  • 1
  • 17
  • 32

2 Answers2

2

REST is HTTP, which is inherently stateless and idempotent. I would not add session to REST services.

Your application that calls REST services is another matter. You can add session if you think it's necessary. But you should be aware of the implications when you do so.

duffymo
  • 305,152
  • 44
  • 369
  • 561
0

spring rest design

Spring still uses Servlet to handle connections and sesions control. It is a little heavy.

finefoot
  • 9,914
  • 7
  • 59
  • 102
darvei
  • 3
  • 2