core: make session cookie name configurable (solves problems where old cookies might interfere, especially on Chrome)

(cherry picked from commit d06834ba2a0af409aee154b6526022c3d6278c97)