Skip to content

Commit

Permalink
login response header edited
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafakucuk-dev committed Dec 26, 2023
1 parent 7304d8c commit 35d6d61
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ class AccessController(
fun login(@RequestBody request: LoginRequest, response: HttpServletResponse){
val sessionId = accessService.login(request.username, request.password)

val cookie = Cookie("SESSIONID", "$sessionId")
cookie.path = "/"
response.addCookie(cookie)
// val cookie = Cookie("SESSIONID", "$sessionId")
// cookie.path = "/"
// response.addCookie(cookie)

// Manually construct the Set-Cookie header value
val cookieValue = "SESSIONID=$sessionId; Path=/; SameSite=None"

// Add the Set-Cookie header to the response
response.addHeader("Set-Cookie", cookieValue)

response.setHeader("Access-Control-Allow-Credentials", "true")
}
Expand Down

0 comments on commit 35d6d61

Please sign in to comment.