1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-22 11:40:18 +00:00

Revert "Add error to SessionExist interface"

This reverts commit 28e6b3b924.
This commit is contained in:
Phillip Stagnet
2020-08-05 18:29:47 +02:00
parent 5f2f6e4f86
commit 3052c64b6c
14 changed files with 48 additions and 109 deletions

View File

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