PerlDancer/Dancer-Session-Cookie

docs: size limit for sessions

isync opened this issue · 1 comments

I think it would be helpful for other users to have a hint in the module's POD, about cookie size limits.

Yesterday I ran into an issue where I was setting session data, twice: first a very big hashref, what looked like one screen page worth of data when dumped - and then, second, a smaller, merely two keys, hashref.
The problem was that the second call to session() was without effect. The routine silently discarded the additional session data. After much digging, I found that the first, large, chunk of data effectively over-filled the session storage. Then, setting additional data silently fails, keys don't stick.

So, at least for Firefox, there's a size-limit for Cookies, obviously. I hear the same is true for Chrome: 4kb.
It might be worth a note, so that other users know that the ::Cookies session store has some limitations.

I admit that I might be on the completely wrong track here, and it's not a browser size-limit issue but something else. I haven't checked the module's source or looked any deeper where this behaviour came from. Only for me, as soon as I reduced the size of stored data, everything worked as expected again.

isync commented

This will be fixed in v0.26, hopefully on CPAN soon.