1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 14:10:39 +00:00

Add interface change in pkg folder

This commit is contained in:
Phillip Stagnet
2020-08-05 18:29:22 +02:00
parent 6f5c5bd3a6
commit 5f2f6e4f86
14 changed files with 107 additions and 49 deletions

View File

@ -68,10 +68,10 @@ func (p *Provider) SessionRead(sid string) (session.Store, error) {
}
// SessionExist judged whether sid is exist in session
func (p *Provider) SessionExist(sid string) bool {
func (p *Provider) SessionExist(sid string) (bool, error) {
if p.client == nil {
if err := p.connectInit(); err != nil {
panic(err)
return false, err
}
}
value, err := p.client.Get(sid)
@ -79,9 +79,9 @@ func (p *Provider) SessionExist(sid string) bool {
panic(err)
}
if value == nil || len(value.(string)) == 0 {
return false
return false, nil
}
return true
return true, nil
}
// SessionRegenerate regenerate session with new sid and delete oldsid