The HTTP protocol is by definition stateless, meaning that it has no mechanism for “remembering” data from one interaction to the next. (a) Suggest a means by which you can preserve state between two HTTP calls. For example, you may send the user a page of books and prices matching a user’s query, and you want to avoid having to look up the price of each book again once the user chooses one to purchase. (b) Suggest a means by which you can preserve some notion of state between two web accesses many days apart. For example, the user may prefer prices quoted in euros instead of dollars, and you want to present prices in the preferred currency next time without asking the user.
What will be an ideal response?
State can be preserved on the client or server end. On the server end, saving state takes space, especially if some interactions are broken (the user does not complete the purchase, perhaps just browsing to collect prices). On the client end, the state information is subject to malicious or nonmalicious modification and loss. Also, there is the difficulty that a “user” is not synonymous with a single workstation: the workstation may be shared, and the user may access two different workstations.
Most sites opt to store state on the client’s machine, using encryption and proprietary formats to limit the amount of modification a user can do.
You might also like to view...
Data cleansing is the process of validating that the data is correct and accurate
Indicate whether the statement is true or false
All of the following are browsers your Web pages should be tested with except __________.
a. Chrome b. WebPro c. Safari d. Firefox