Search code examples
ruby-on-railsreststateless

Ruby on Rails as a RESTful architecture


Whenever I read about REST architecture, there is always a word about stateless operations.From my basic understanding Ruby on Rails is supposed to be of REST architecture. From my understanding stateless operations means consecutive requests are independent of each other. But in Ruby on Rails we do have session variables and cookies that sort of keeps track of some data from one request to another. Doesn't this defy stateless operations? I am confused. Can someone please clarify?


Solution

  • But in Ruby on Rails we do have session variables and cookies that sort of keeps track of some data from one request to another. Doesn't this defy stateless operations?

    No, the requests remain "stateless" (with cookie-based session storage), because cookies are sent with every request (instead of being tracked on the server). Therefore, each request contains all info required for its processing, making it independent from all previous requests.