diff options
Diffstat (limited to 'model/session.go')
-rw-r--r-- | model/session.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/model/session.go b/model/session.go index 8a5eec74c..ef51374db 100644 --- a/model/session.go +++ b/model/session.go @@ -83,7 +83,11 @@ func (me *Session) IsExpired() bool { } func (me *Session) SetExpireInDays(days int) { - me.ExpiresAt = GetMillis() + (1000 * 60 * 60 * 24 * int64(days)) + if me.CreateAt == 0 { + me.ExpiresAt = GetMillis() + (1000 * 60 * 60 * 24 * int64(days)) + } else { + me.ExpiresAt = me.CreateAt + (1000 * 60 * 60 * 24 * int64(days)) + } } func (me *Session) AddProp(key string, value string) { |