scs icon indicating copy to clipboard operation
scs copied to clipboard

Fix write before pop not removing value

Open jackielii opened this issue 1 year ago • 1 comments

fix #215

jackielii avatar Jul 03 '24 20:07 jackielii

The test still fails because we can't write the header after the first w.Write, at which point the header is already written. Therefore the set-cookie response header of first /get is still empty. I don't know there is a better way. If you think it's acceptable, I'll modify the test

jackielii avatar Jul 03 '24 21:07 jackielii

@jackielii Sorry, I think this PR has the right general idea behind it, but I'm going to close it because it now has some merge commits that I'd prefer not to work through, the error from the call to s.Commit is also ignored and needs to be handled, and we also need some additional documentation in place for the RenewToken and Destroy methods to explain that they must be called before the first write.

I'll tackle these in a new commit to address https://github.com/alexedwards/scs/issues/215.

alexedwards avatar Oct 01 '25 15:10 alexedwards