|
|
@@ -1,8 +1,10 @@
|
|
|
package com.style24.front.support.config;
|
|
|
|
|
|
import org.springframework.beans.factory.BeanClassLoaderAware;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
|
|
import org.springframework.data.redis.serializer.RedisSerializer;
|
|
|
import org.springframework.security.jackson2.SecurityJackson2Modules;
|
|
|
@@ -34,6 +36,9 @@ public class TsfRedisSessionConfig extends AbstractHttpSessionApplicationInitial
|
|
|
|
|
|
private ClassLoader classLoader;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private Environment env;
|
|
|
+
|
|
|
@Override
|
|
|
public void setBeanClassLoader(ClassLoader classLoader) {
|
|
|
this.classLoader = classLoader;
|
|
|
@@ -86,12 +91,13 @@ public class TsfRedisSessionConfig extends AbstractHttpSessionApplicationInitial
|
|
|
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
|
|
|
serializer.setCookiePath("/");
|
|
|
serializer.setUseBase64Encoding(false);
|
|
|
-// serializer.setSameSite("NONE");
|
|
|
+ String active = env.getProperty("spring.profiles.active");
|
|
|
// TODO : SSL 적용 후 주석 풀고 테스트 해야함 2021-04-13
|
|
|
// SSL인증서 적용 시 주석 제거
|
|
|
-// serializer.setUseSecureCookie(true);
|
|
|
-// serializer.setSameSite("NONE");
|
|
|
-
|
|
|
+ if ("run".equals(active)) {
|
|
|
+ serializer.setUseSecureCookie(true);
|
|
|
+ serializer.setSameSite("NONE");
|
|
|
+ }
|
|
|
return serializer;
|
|
|
}
|
|
|
|