文档里说:
Returns the current HttpSession associated with this request or, if if there is no current session and create is true, returns a new session.
Returns the current HttpSession associated with this request or, if if there is no current session and create is true, returns a new session.
session
你可以认为是每一个
IE
进程对应一个会话(你新开一个
IE
进程就可以对应两个会话的)
getSession 都是返回当前用户的会话对象,参数的区别在于
参数为 true ,则如果 “ 当前用户的会话对象 ” 为空(第一次访问时)则创建一个新的会话对象返回
参数为 false ,则如果 “ 当前用户的会话对象 ” 为空,则返回 null (即不自动创建会话对象)
getSession 都是返回当前用户的会话对象,参数的区别在于
参数为 true ,则如果 “ 当前用户的会话对象 ” 为空(第一次访问时)则创建一个新的会话对象返回
参数为 false ,则如果 “ 当前用户的会话对象 ” 为空,则返回 null (即不自动创建会话对象)