Skip to content
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

Session slice stops accepting new items #109

Closed
ekkapob opened this issue Mar 27, 2017 · 4 comments
Closed

Session slice stops accepting new items #109

ekkapob opened this issue Mar 27, 2017 · 4 comments

Comments

@ekkapob
Copy link

ekkapob commented Mar 27, 2017

Are are any limit to the session? I have code below to append a new item to the slice. It works many items until some point I can't retrieve the new item data, like it stops accepting the new item after save.

I tried to print out the session store after session.save the data are in there. But in another handler, it can't see the new item. I registered all of the structs with gob, still not working. I have no clue because it works and then stop working like the session doesn't accept the new slice item, but editing the existing value still works.

// order.List = []Item
order.List = append(order.List, Item{name: "abc"})
session["order"] = order
session.Save(r, w)
// print here shows the new added item

but another handle doesn't see the new added item.

@elithrar
Copy link
Contributor

elithrar commented Mar 27, 2017 via email

@ekkapob
Copy link
Author

ekkapob commented Mar 27, 2017

@elithrar thank you! you are right the error says securecookie: the value is too long
With this, does the only option I have is using FilesystemStore instead with increase MaxLength? Checked with the session but not found any option to increase the size.

@elithrar
Copy link
Contributor

elithrar commented Mar 27, 2017 via email

@ekkapob
Copy link
Author

ekkapob commented Mar 28, 2017

Thank you @elithrar for the answer and advice. I end up do the checking and warn the user as they shouldn't keep adding (temporary) things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants