title: @SessionScoped / @Stateful - how do they managed session/state
body: <p>I am fairly new to Java EE. I was going through CDI and EJB material and came across @SessionScoped and @Stateful annotation.</p>
  
  <p>Looking at the definition :
  @SessionScope: A user’s interaction with a web application across multiple HTTP requests is maintained.</p>
  
  <p>@Statfeful : looks like it has the same functionality as @SessionScope</p>
  
  <p>So here are my doubts :</p>
  
  <p>1) Do both of them serve the same purpose ?
  2) I have a bit of experience with Node and Python. In those languages for maintaining client state I always used a cookie which is tied to an HTTPSession object which is further tied to an in-memory cache(redis/memcache) for distribution across all the servers. </p>
  
  <p>So I can use the same technique here as well... correct ? Then why should I use these notations ? Also, if I plan to use them, then how to make them distributed across all servers?
  I mean a request from client can come to server1 and then next request can go to server2 ..in that case if this SesssionScoped object is not distributed then how will things work correctly ?  </p>
  
  <p>What is the purpose of these annotation ?</p>