Skip to content

Instantly share code, notes, and snippets.

@jacktams
Created June 29, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacktams/2694514f60bb3d4fa851c73bf785ee1b to your computer and use it in GitHub Desktop.
Save jacktams/2694514f60bb3d4fa851c73bf785ee1b to your computer and use it in GitHub Desktop.
<h2>test</h2>
<%
response.setHeader("Set-Cookie", "test=62CBD73375A66446766D698B3890BBB1; Path=/test; HttpOnly; Secure;");
response.setHeader("Set-Cookie", "none=62CBD73375A66446766D698B3890BBB1; Path=/test; HttpOnly; Secure; SameSite=none");
Cookie cookie = new Cookie("key","value");
response.addCookie(cookie);
Cookie[] cookies = request.getCookies();
for(int i = 0; i < cookies.length; i++){
out.print(cookies[i].getName() + " -> " + cookies[i].getValue());
out.println("</br>");
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment