Beego: 请问beego 设置session的时候存的数据是怎样的数据编码

Created on 31 Jan 2019  ·  2Comments  ·  Source: astaxie/beego

就比如存储
value如下
\x0E\xFF\x81\x04\x01\x02\xFF\x82\x00\x01\x10\x01\x10\x00\x00\x04\xFF\x82\x00\x00
如何解码,变成可读性强的具体字符串

aresession kinquestion

Most helpful comment

you can decode blob bytes of session by using
"github.com/astaxie/beego/session"

var kv map[interface{}]interface{}
v, err = session.DecodeGob([]byte(s["sessiondata"].([]uint8)))

if in your db sessiondata filed name is session_data replace "sessiondata" with "session_data"

All 2 comments

you can decode blob bytes of session by using
"github.com/astaxie/beego/session"

var kv map[interface{}]interface{}
v, err = session.DecodeGob([]byte(s["sessiondata"].([]uint8)))

if in your db sessiondata filed name is session_data replace "sessiondata" with "session_data"

...

Was this page helpful?
0 / 5 - 0 ratings