What is session management in Java?

后端 未结 6 1262
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-23 18:20

I have faced this question in my Interview as well. I do have many confusion with Session Scope & it management in java.

In web.xml we do have the entry :

<
6条回答
  •  感动是毒
    2020-12-23 18:49

    Servlets in Java have an HttpSession object which you can use to store state information for a user. The session is managed on the client by a cookie (JSESSIONID) or can be done using URL rewrites. The session timeout describes how long the server will wait after the last request before deleting the state information stored in a HttpSession.

    The scope is per browser instance, so in the example you give logging in from two different pcs will result in two session objects.

提交回复
热议问题