001/** 002 * Copyright (c) 2015-2022, Michael Yang 杨福海 (fuhai999@gmail.com). 003 * <p> 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * <p> 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * <p> 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package io.jboot.web.session; 017 018import io.jboot.app.config.annotation.ConfigModel; 019 020@ConfigModel(prefix = "jboot.web.session") 021public class JbootSessionConfig { 022 023 public final static int DEFAULT_MAX_INACTIVE_INTERVAL = 60 * 60; 024 public final static String DEFAULT_COOKIE_CONTEXT_PATH = "/"; 025 public final static int DEFAULT_COOKIE_MAX_AGE = -1; 026 public final static String DEFAULT_SESSION_COOKIE_NAME = "_JSID"; 027 public final static String DEFAULT_SESSION_CACHE_NAME = "JBOOTSESSION"; 028 029 030 private String cookieName = DEFAULT_SESSION_COOKIE_NAME; 031 private String cookieDomain; 032 private String cookieContextPath = DEFAULT_COOKIE_CONTEXT_PATH; 033 private int maxInactiveInterval = DEFAULT_MAX_INACTIVE_INTERVAL; 034 private int cookieMaxAge = DEFAULT_COOKIE_MAX_AGE; 035 036 private String cacheName = DEFAULT_SESSION_CACHE_NAME; 037 private String useCacheName = "default"; 038 039 040 public String getCookieName() { 041 return cookieName; 042 } 043 044 public void setCookieName(String cookieName) { 045 this.cookieName = cookieName; 046 } 047 048 public String getCookieDomain() { 049 return cookieDomain; 050 } 051 052 public void setCookieDomain(String cookieDomain) { 053 this.cookieDomain = cookieDomain; 054 } 055 056 public String getCookieContextPath() { 057 return cookieContextPath; 058 } 059 060 public void setCookieContextPath(String cookieContextPath) { 061 this.cookieContextPath = cookieContextPath; 062 } 063 064 public int getMaxInactiveInterval() { 065 return maxInactiveInterval; 066 } 067 068 public void setMaxInactiveInterval(int maxInactiveInterval) { 069 this.maxInactiveInterval = maxInactiveInterval; 070 } 071 072 public int getCookieMaxAge() { 073 return cookieMaxAge; 074 } 075 076 public void setCookieMaxAge(int cookieMaxAge) { 077 this.cookieMaxAge = cookieMaxAge; 078 } 079 080 public String getCacheName() { 081 return cacheName; 082 } 083 084 public void setCacheName(String cacheName) { 085 this.cacheName = cacheName; 086 } 087 088 public String getUseCacheName() { 089 return useCacheName; 090 } 091 092 public void setUseCacheName(String useCacheName) { 093 this.useCacheName = useCacheName; 094 } 095 096}