Differences between cookies and sessions?

前端 未结 9 1835
时光取名叫无心
时光取名叫无心 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条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 00:57

    Cookie is basically a global array accessed across web browsers. Many a times used to send/receive values. it acts as a storage mechanism to access values between forms. Cookies can be disabled by the browser which adds a constraint to their use in comparison to session.

    Session can be defined as something between logging in and logging out. the time between the user logging in and logging out is a session. Session stores values only for the session time i.e before logging out. Sessions are used to track the activities of the user, once he logs on.

提交回复
热议问题