Skip to content

Commit 46243f4

Browse files
committed
feat:>extend cookie max age/#118
1 parent 9eff9f0 commit 46243f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pro/src/main/java/com/example/pro/auth/utils/CookieUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import java.util.Base64;
99

1010
public class CookieUtil {
11+
12+
private static final int EXPIRE_SECONDS = 30 * 60;
13+
1114
public static String getCookieValue(HttpServletRequest request, String name) {
1215
Cookie[] cookies = request.getCookies();
1316

@@ -27,7 +30,7 @@ public static void addCookie(HttpServletResponse response, String name, String v
2730
cookie.setSecure(true);
2831
cookie.setHttpOnly(true);
2932
cookie.setAttribute("SameSite", "None");
30-
cookie.setMaxAge(300);
33+
cookie.setMaxAge(EXPIRE_SECONDS);
3134

3235
response.addCookie(cookie);
3336
}

0 commit comments

Comments
 (0)