Skip to content

Commit

Permalink
[Enhancement] Set cookie path & http_only to make it more safe
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Satardekar <[email protected]>
  • Loading branch information
rohitrs1983 committed Sep 20, 2024
1 parent 266bfc8 commit a4e89d2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ protected void addSession(BaseRequest request, BaseResponse response, SessionVal
String key = UUID.randomUUID().toString();
DefaultCookie cookie = new DefaultCookie(STARROCKS_SESSION_ID, key);
cookie.setMaxAge(STARROCKS_SESSION_EXPIRED_TIME);
cookie.setPath("/");
cookie.setHttpOnly(true);
response.addCookie(cookie);
HttpAuthManager.getInstance().addSessionValue(key, value);
}
Expand Down

0 comments on commit a4e89d2

Please sign in to comment.