You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general, all HTTP headers must be set and finalized before any content is written. This means you basically have to buffer the output if you intent to modify the session while producing output (very common when popping flash messages). This has bitten me quite a few times.
In general, all HTTP headers must be set and finalized before any content is written. This means you basically have to buffer the output if you intent to modify the session while producing output (very common when popping flash messages). This has bitten me quite a few times.
Yes, I spend one afternoon tracking down the problem. My call stack was too deep, I didn't even suspect session manager at first.
I think even if it's decided that this is expected, I prefer to have a error or even panic for this so that I know what not to do.
In addition, my initial issue was the message not removed after Pop call. So I'm fine with the set-cookie header not present, but the values have to be removed from store.
This is caused by
scs/session.go
Lines 158 to 160 in 7e11d57
As demostrated in #216
scs/session_test.go
Lines 351 to 391 in 8650757
If
Pop
happens after aw.Write
,sw.written
would betrue
. Therefore the commit would never happenThe second
/get
should have empty response, but it gotbar
instead:The text was updated successfully, but these errors were encountered: