Java secure session

前端 未结 4 1798
感动是毒
感动是毒 2020-12-11 18:10

Whenever you authenticate, your application should change the session identifier it uses. This helps to prevent someone from setting up a session, copying the session identi

4条回答
  •  时光说笑
    2020-12-11 19:14

    Invalidate the current session and the get a new session:

    //invalidate the current session
    request.getSession().invalidate();
    /*
    get another session and get the ID (getSession()) will create a session if one does not exist
    */
    request.getSession().getId();
    

提交回复
热议问题