What are three ways in which web applications can provide a stateful experience for the user?(using http) I know Sessions and Cookies are two of them, but don't know a third (database??)
Yes a question from a lecture.
What are three ways in which web applications can provide a stateful experience for the user?(using http) I know Sessions and Cookies are two of them, but don't know a third (database??)
Yes a question from a lecture.
There's more than three.
Basically anything that can be used persist data across a web request can be used to store state.
There are effectively only two approaches:
The way the context data is persisted between requests and, for the systems that are based upon identifying the user, the way the identity is supplied, provide many variations upon the two approaches listed above. For example:
(*) edit: I had originally ViewState marked as a session ID passing device, but as pointed by erikkallen, the default use of ViewState is with passing the context info, not the ID.
In the end, however, it all hinges on whether the context is stored server side or shuttled to/from the client with each request.
Querystrings are one of the most common ways of doing this. E.g.
http://www.site.com/products/index.aspx?productId=3&page=2&showInactive=n
Looks like a homework question. Anyway, it's vague.. Ways to track a user? Ways to store a user's data?
Tracking can be done with cookies, url token or a hidden field (in case of forms).
Storing data can be done a lot of different ways.
The most common scenario is storing a session id in a cookie, and using that id to retrieve the user's session.
AJAX is the 3rd piece to making the stateless web application appear as stateful.
It's still submitting requests behind the scenes, but to the user - the screen doesn't refresh or look like a website.
You can have a database driven website, but it won't be stateful.