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

Add ctx to session API

This commit is contained in:
Ming Deng
2020-08-30 15:39:07 +00:00
parent 0019e0fc1b
commit 670064686e
23 changed files with 302 additions and 288 deletions

View File

@ -361,7 +361,7 @@ func (input *BeegoInput) Cookie(key string) string {
// Session returns current session item value by a given key.
// if non-existed, return nil.
func (input *BeegoInput) Session(key interface{}) interface{} {
return input.CruSession.Get(key)
return input.CruSession.Get(nil, key)
}
// CopyBody returns the raw request body data as bytes.

View File

@ -404,5 +404,5 @@ func stringsToJSON(str string) string {
// Session sets session item value with given key.
func (output *BeegoOutput) Session(name interface{}, value interface{}) {
output.Context.Input.CruSession.Set(name, value)
output.Context.Input.CruSession.Set(nil, name, value)
}