Skip to content

Commit ecd15b0

Browse files
committed
hotfix: 쿠키에 max-age 값 없어서 세션 쿠키로 인식되고, 브라우저 종료시 아에 쿠키 삭제되어버림
1 parent 059a4c0 commit ecd15b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/controllers/user.controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export class UserController {
1212
constructor(private userService: UserService) { }
1313

1414
private cookieOption(): CookieOptions {
15+
// eslint-disable-next-line @typescript-eslint/naming-convention
16+
const THREE_WEEKS_IN_MS = 21 * 24 * 60 * 60 * 1000;
1517
const isProd = process.env.NODE_ENV === 'production';
1618

1719
const baseOptions: CookieOptions = {
@@ -22,6 +24,7 @@ export class UserController {
2224
if (isProd) {
2325
baseOptions.sameSite = 'lax';
2426
baseOptions.domain = "velog-dashboard.kro.kr";
27+
baseOptions.maxAge = THREE_WEEKS_IN_MS; // 3주
2528
} else {
2629
baseOptions.domain = 'localhost';
2730
}

0 commit comments

Comments
 (0)