|
CookiesBesides the cookies used by google analytics, which are obfuscated by javascript, happs-tutorial
uses cookies to track session state -- the data that corresponds to the current user's session in
When you log in, a cookie is created that expires in an hour (3600 seconds). Every time a happstack handler needs to check if a user is logged in (for example, when it needs to decide whether to show the logged-in-user menubar), a check is made to see if a cookie has been set. The cookie code is in ControllerMisc.hs:
As you can see, the basic use of cookies is surprisingly simple with the two functions addCookie and mkCookie We've spent a good bit of time now on how happstack-server handles requests, so we're ready to move on to the major feature of happstack-state, MACID. |