A new pull-request regarding double session cookies at http response (this time with a unit-test demostrating the issue)

The previouslly proposed fix is still present at this pull-req, but I will amend this pull-request with the accepted solution once an agreement is reached. ;)