Skip to content

Commit

Permalink
feat: .setHttpOnly() 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dy102 committed Nov 30, 2023
1 parent bd2bbd1 commit 6c0c7fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@ public Cookie addViewCountByCookie(HttpServletRequest request, Long postId) {
if (!oldCookie.getValue().contains("[" + postId + "]")) {
oldCookie.setValue(oldCookie.getValue() + "[" + postId + "]");
oldCookie.setPath("/");
oldCookie.setHttpOnly(false);
addViewCount(postId);
}
return oldCookie;
}

Cookie newCookie = new Cookie(VIEW_COOKIE_NAME, "[" + postId + "]");
newCookie.setPath("/");
newCookie.setHttpOnly(false);
addViewCount(postId);
return newCookie;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ public Cookie addVisitCountByCookie(HttpServletRequest request, Long blogId) {
if (!oldCookie.getValue().contains("[" + blogId + "]")) {
oldCookie.setValue(oldCookie.getValue() + "[" + blogId + "]");
oldCookie.setPath("/");
oldCookie.setHttpOnly(false);
addVisitCount(blogId);
}
return oldCookie;
}

Cookie newCookie = new Cookie(VISIT_COOKIE_NAME, "[" + blogId + "]");
newCookie.setPath("/");
newCookie.setHttpOnly(false);
addVisitCount(blogId);
return newCookie;
}
Expand Down

0 comments on commit 6c0c7fc

Please sign in to comment.