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:
@ -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.
|
||||
|
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user