Differences between cookies and sessions?

前端 未结 9 1840
时光取名叫无心
时光取名叫无心 2020-11-28 00:42

I am training in web developement and am learning about JSP & Servlets. I have some knowledge of HttpSession - I have used

9条回答
  •  旧时难觅i
    2020-11-28 00:57

    Session in Asp.net:

    1.Maintains the data accross all over the application.

    2.Persists the data if current session is alive. If we need some data to accessible from multiple controllers acitons and views the session is the way to store and retreive data.

    3.Sessions are server side files that contains user information. [Sessions are unique identifier that maps them to specific users]

    Translating that to Web Servers: The server will store the pertinent information in the session object, and create a session ID which it will send back to the client in a cookie. When the client sends back the cookie, the server can simply look up the session object using the ID. So, if you delete the cookie, the session will be lost.

提交回复
热议问题