how do I test httpOnly cookie flag

前端 未结 4 2049
北海茫月
北海茫月 2021-02-18 21:18

I have set the following property in websphere for the jsession cookie com.ibm.ws.webcontainer.HTTPOnlyCookies.

Any idea how best to test this using Jav

4条回答
  •  天涯浪人
    2021-02-18 22:01

    add the following lines to your app String

    sessionid = request.getSession().getId();
    response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + "; secure; HttpOnly");
    

提交回复
热议问题