feat(session): support v1

support v1
This commit is contained in:
Alan Xu
2024-08-03 22:57:53 +08:00
committed by Ming Deng
parent 3c6986a5c4
commit 17e916f4a0
14 changed files with 349 additions and 68 deletions

View File

@@ -20,8 +20,10 @@
//
// Usage:
// import(
// _ "github.com/beego/beego/session/couchbase"
// "github.com/beego/beego/session"
//
// _ "github.com/beego/beego/session/couchbase"
// "github.com/beego/beego/session"
//
// )
//
// func init() {
@@ -113,6 +115,12 @@ func (cs *SessionStore) SessionRelease(w http.ResponseWriter) {
cs.b.Set(cs.sid, int(cs.maxlifetime), bo)
}
// SessionReleaseIfPresent is not supported now.
// If we want to use couchbase, we may refactor the code to use couchbase collection.
func (cs *SessionStore) SessionReleaseIfPresent(w http.ResponseWriter) {
cs.SessionRelease(w)
}
func (cp *Provider) getBucket() *couchbase.Bucket {
c, err := couchbase.Connect(cp.savePath)
if err != nil {