коммит произвёл
Claudio Costa
родитель
623f8dc9af
Коммит
7a3fe61bf6
@@ -125,17 +125,6 @@ func (s *Session) IsExpired() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: SetExpireInDays is deprecated and should not be used.
|
|
||||||
// Use (*App).SetSessionExpireInDays instead which handles the
|
|
||||||
// cases where the new ExpiresAt is not relative to CreateAt.
|
|
||||||
func (s *Session) SetExpireInDays(days int) {
|
|
||||||
if s.CreateAt == 0 {
|
|
||||||
s.ExpiresAt = GetMillis() + (1000 * 60 * 60 * 24 * int64(days))
|
|
||||||
} else {
|
|
||||||
s.ExpiresAt = s.CreateAt + (1000 * 60 * 60 * 24 * int64(days))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *Session) AddProp(key string, value string) {
|
func (s *Session) AddProp(key string, value string) {
|
||||||
|
|
||||||
if s.Props == nil {
|
if s.Props == nil {
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ func TestSessionJson(t *testing.T) {
|
|||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
|
||||||
require.True(t, session.IsExpired(), "Should expire")
|
require.True(t, session.IsExpired(), "Should expire")
|
||||||
|
|
||||||
session.SetExpireInDays(10)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSessionCSRF(t *testing.T) {
|
func TestSessionCSRF(t *testing.T) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user