title: How to distinguish application state and resource state
body: <p>I know that to make a stateless application, we need to transfer the user state back and forth instead of server holds the user state.</p>
  
  <p>However, there must be some states stored in the server, I read this <a href="http://ruben.verborgh.org/blog/2012/08/24/rest-wheres-my-state/" rel="noreferrer">article</a> that the state stored in server is called resource state.So if I am right, client state which we often call should be the same as application state.</p>
  
  <p>So, how do I distinguish these two, since it will determine that whether they should stored in server or transferred.</p>
  
  <p>Take a shopping cart as an example. </p>
  
  <ol>
  <li><p>If there is 5 steps before a user to complete his purchase, the user's phase where he is(#3,#4) in seems to be an application state, but does this mean if they close the browser and click on pay again, he will have to start from the step1? </p></li>
  <li><p>What about the items in his chart? If we treat it as application state, we need to put all of the items in the request. But if we do this, when user close the browser and login again, he will not able to find his items again, since the browser can not remember all the items. So it seems we should treat it as a resource state. But if so, when a user click on pay , they will have a different page: go to pay or say "your cart is empty" based on whether his shopping cart is empty or not. So , the same requests with exactly the same param input, comes out the different result, can we still say it is stateless?</p></li>
  </ol>
  
  <p>Maybe I understand something wrong, can any body please answer how to distinguish different kinds of state and how to treat them differently? </p>