Tracking after the back button

I want to write a web application ordering system using the REST methodology for the first time. I understand the concept of "message id" when things are sent to the page, but this script appears. When a user is sent to a web application, you can track your status with an identifier attached to a URI, but what happens if they click the back button of the browser on the entry point of the application when they had no identifier? Then they lose their state in the transaction.

I know that you can always give them cookies, but you cannot do this if they have cookies disabled and, in the worst case, they are disabled here.

Now I understand that the answer may be “Yes, what will happen”, that the end of the story, and I can live with it, but as a newbie to this, is there something that I am missing?

+3
source share
3 answers

The answer is that your application (in a REST script) simply does not track what is happening. All state is controlled by the client, and state transitions are carried out through navigation by URI. The “State Transfer” part of REST refers to client navigation for new URIs that are new states.

URI, GET, , HTTP, REST. , "" URI, "", , GET .

, ( -HTTP)...

GET//site.com/product/123

(, , ) 123, URI, . . , , :

POST//site.com/shoppingcart/ {productid = 123}

( URI DELETE, ) (, XML, URI, ). .

"" , . , . ( , ...) , . , - .

, cookie, javascript . REST script - - XSLT XML , , , , -.

REST, , . , ( ).

, "" REST, :

http://www.infoq.com/articles/subbu-allamaraju-rest

+3

REST ; . ; . , , , REST .

, :

  • cookies? , ?
  • , JS? , PUT () DELETE () AJAX?

: cookie JavaScript, RESTful . . . , / , , . , "", , , . , , . , , cookie, .

PUT DELETE HTTP? , POST, , , - , - . GET .

+4

, "S" REST "" "T" "". , . , , .

, .

0

Source: https://habr.com/ru/post/1715991/


All Articles