-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int value not stored #29
Comments
Can you test whether int64 works? |
Just tried, int64 works. cval,ok := store.Get("incr").(int64)
if ok {
cval++
}else{
log.Println("get incr failed,cval",cval)
cval = 1
}
store.Set("incr", cval)
sessionID := store.GetSessionID()
ctx.SetBodyString(fmt.Sprintf("Session(%s) SET: incr='%d' --> OK", sessionID, store.Get("incr").(int64)))
|
Hi @tgarm and @thomasvvugt, Sorry for delayed answer, i was in vacation. The base enconder/decoder of session is So the "trick" or the correct way is to always use |
Hi @savsgio, thanks for your response. |
It seems the int value is not stored correctly in session.
When serving with the following test code, GET from /, the value of session['incr'] is expected to increment each time, but it always keep the same.
The code uses sqlite3 as the provider.
Is the code written wrongly or session does not support int type, or it is a bug of the session provider?
Please have a look at this code:
The text was updated successfully, but these errors were encountered: