/
githubmirror
/
GoFrame
Обзор
Документация
Войти
/
githubmirror
/
GoFrame
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
net/ghttp/ghttp_server_config_session.go
53 строки
2 KB
John Guo
version 2
11 окт 2021, 16:41
11 окт 2021, 16:41
1bc0635
Код
Авторство
О чём код?
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package ghttp import ( "time" "github.com/gogf/gf/v2/os/gsession" ) // SetSessionMaxAge sets the SessionMaxAge for server. func (s *Server) SetSessionMaxAge(ttl time.Duration) { s.config.SessionMaxAge = ttl } // SetSessionIdName sets the SessionIdName for server. func (s *Server) SetSessionIdName(name string) { s.config.SessionIdName = name } // SetSessionStorage sets the SessionStorage for server. func (s *Server) SetSessionStorage(storage gsession.Storage) { s.config.SessionStorage = storage } // SetSessionCookieOutput sets the SetSessionCookieOutput for server. func (s *Server) SetSessionCookieOutput(enabled bool) { s.config.SessionCookieOutput = enabled } // SetSessionCookieMaxAge sets the SessionCookieMaxAge for server. func (s *Server) SetSessionCookieMaxAge(maxAge time.Duration) { s.config.SessionCookieMaxAge = maxAge } // GetSessionMaxAge returns the SessionMaxAge of server. func (s *Server) GetSessionMaxAge() time.Duration { return s.config.SessionMaxAge } // GetSessionIdName returns the SessionIdName of server. func (s *Server) GetSessionIdName() string { return s.config.SessionIdName } // GetSessionCookieMaxAge returns the SessionCookieMaxAge of server. func (s *Server) GetSessionCookieMaxAge() time.Duration { return s.config.SessionCookieMaxAge }