agrafix / Spock

Another Haskell web framework for rapid development
https://www.spock.li
679 stars 56 forks source link

Spock not generating new sessionId #141

Closed ohri-anurag closed 6 years ago

ohri-anurag commented 6 years ago

Hi,

It seems that Spock is not generating a new session Id for the same browser, even when the browser is restarted.

The issue can be reproduced in the Getting Started example by printing out the session id whenever root is accessed.

Is there something I'm missing or some setting that I can use? Any help would be greatly appreciated.

Thanks

ohri-anurag commented 6 years ago

It seems that browsers nowadays don't clear the session cookie when they are closed. That was causing Spock to reuse the previously generated session id.

agrafix commented 6 years ago

You can generate new session IDs using: http://hackage.haskell.org/package/Spock-0.12.0.0/docs/Web-Spock-SessionActions.html#v:sessionRegenerateId