summaryrefslogtreecommitdiffstats
path: root/model/session.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-07-21 08:36:11 -0800
committerJoram Wilander <jwawilander@gmail.com>2016-07-21 12:36:11 -0400
commit946302d9a29cbf5702da9e18a52b59864a18c69e (patch)
tree2cd2520fc57c2a0681cc938b5e1adcd7b01c8d44 /model/session.go
parentbfa04c0ab0eca5d812ad64e5f51e95ec458cf0d3 (diff)
downloadchat-946302d9a29cbf5702da9e18a52b59864a18c69e.tar.gz
chat-946302d9a29cbf5702da9e18a52b59864a18c69e.tar.bz2
chat-946302d9a29cbf5702da9e18a52b59864a18c69e.zip
PLT-3691 Fixing mobile session (#3652)
* PLT-3691 Fixing mobile session * Fixing unit tests
Diffstat (limited to 'model/session.go')
-rw-r--r--model/session.go6
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) {