Java HttpSession

前端 未结 5 905
眼角桃花
眼角桃花 2021-02-02 16:51

Is HttpSession in java servlet is created only after

HttpSession s = request.getSession();

?

In my code I didn\'t write that, but when

5条回答
  •  失恋的感觉
    2021-02-02 17:44

    A HttpSession is created when calling request.getSession().

    But if you access a JSP by default it will automatically create a session.This behaviour can be disabled by using: <%@ page session="false">

    Are you using JSP?

提交回复
热议问题