-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
ghttp_server_config_cookie.go
53 lines (45 loc) · 1.31 KB
/
ghttp_server_config_cookie.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2017 gf Author(https://github.com/gogf/gf). 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 (
"github.com/gogf/gf/g/os/glog"
)
// 设置http server参数 - CookieMaxAge
func (s *Server) SetCookieMaxAge(age int) {
if s.Status() == SERVER_STATUS_RUNNING {
glog.Error(gCHANGE_CONFIG_WHILE_RUNNING_ERROR)
return
}
s.config.CookieMaxAge = age
}
// 设置http server参数 - CookiePath
func (s *Server) SetCookiePath(path string) {
if s.Status() == SERVER_STATUS_RUNNING {
glog.Error(gCHANGE_CONFIG_WHILE_RUNNING_ERROR)
return
}
s.config.CookiePath = path
}
// 设置http server参数 - CookieDomain
func (s *Server) SetCookieDomain(domain string) {
if s.Status() == SERVER_STATUS_RUNNING {
glog.Error(gCHANGE_CONFIG_WHILE_RUNNING_ERROR)
return
}
s.config.CookieDomain = domain
}
// 获取http server参数 - CookieMaxAge
func (s *Server) GetCookieMaxAge() int {
return s.config.CookieMaxAge
}
// 获取http server参数 - CookiePath
func (s *Server) GetCookiePath() string {
return s.config.CookiePath
}
// 获取http server参数 - CookieDomain
func (s *Server) GetCookieDomain() string {
return s.config.CookieDomain
}