feat(session): support v1
support v1
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
// go install github.com/go-sql-driver/mysql
|
||||
//
|
||||
// mysql session support need create table as sql:
|
||||
//
|
||||
// CREATE TABLE `session` (
|
||||
// `session_key` char(64) NOT NULL,
|
||||
// `session_data` blob,
|
||||
@@ -28,8 +29,10 @@
|
||||
//
|
||||
// Usage:
|
||||
// import(
|
||||
// _ "github.com/beego/beego/session/mysql"
|
||||
// "github.com/beego/beego/session"
|
||||
//
|
||||
// _ "github.com/beego/beego/session/mysql"
|
||||
// "github.com/beego/beego/session"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func init() {
|
||||
@@ -117,6 +120,11 @@ func (st *SessionStore) SessionRelease(w http.ResponseWriter) {
|
||||
b, time.Now().Unix(), st.sid)
|
||||
}
|
||||
|
||||
// SessionReleaseIfPresent save mysql session values to database.
|
||||
func (st *SessionStore) SessionReleaseIfPresent(w http.ResponseWriter) {
|
||||
st.SessionRelease(w)
|
||||
}
|
||||
|
||||
// Provider mysql session provider
|
||||
type Provider struct {
|
||||
maxlifetime int64
|
||||
|
||||
Reference in New Issue
Block a user