Difference between request.getSession() and request.getSession(true)

后端 未结 7 1760
难免孤独
难免孤独 2021-01-31 08:43

I understand the difference between request.getSession(true) and request.getSession(false). But request.getSession() & request.g

7条回答
  •  旧巷少年郎
    2021-01-31 09:04

    A major practical difference is its use:

    in security scenario where we always needed a new session, we should use request.getSession(true).

    request.getSession(false): will return null if no session found.
    

提交回复
热议问题