//獲取Session對象 request.getSession() request.getSession(boolean create) //獲取SessionId getId() //獲取當前session對象的創建時間 getCreationTime() //獲取最后一次訪問該session對象的時間 getLastAccessedTime() //設置Session最大時效 setMaxInactiveInterval() //獲取Session最大時效 getMaxInactiveInterval() //判斷當前Session對象是不是新建的 /** 如果客戶端請求消息中返回了一個與Servlet程序當前獲得的HttpSession對象的會話標識號相同的會話標識號,則認為這個HttpSession對象不是新建的。 */ isNew() //銷毀當前Session對象 invalidate() //屬性相關 setAttribute() getAttribute() removeAttribute() getAttributeNames()