Skip to content

Commit

Permalink
[Feat]: 세션 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Aug 30, 2024
1 parent eeea115 commit 2845ebf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ fun HttpSession.getLoginUserDetails(): LoginUserDetails? {
fun HttpSession.setLoginUserDetails(userModel: UserModel) {
this.setAttribute("userId", userModel.id)
this.setAttribute("role", userModel.role.name)
this.maxInactiveInterval = 60 * 60 // 1시간
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class WebSecurityConfig(
@Bean
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
http.csrf{it.disable()}
http.sessionManagement{ it.sessionCreationPolicy(SessionCreationPolicy.STATELESS)}
http.sessionManagement{
it.sessionCreationPolicy(SessionCreationPolicy.NEVER)
it.sessionFixation().none()
}
http.formLogin{it.disable()}
http.httpBasic{it.disable()}
http.logout{it.disable()}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spring: # test profile
session:
redis:
namespace: novelcia
flush-mode: on_save
timeout: 3600
lifecycle:
timeout-per-shutdown-phase: 15s # 스프링이 종료될때 모든 작업이 종료될때 까지 기다리는 시간
task:
Expand Down

0 comments on commit 2845ebf

Please sign in to comment.