diff --git a/CHANGES b/CHANGES
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+Version 0.5.2 released 1 Feb 2009
+
+* Fixed cookie problem caused by empty value fields.
+
 Version 0.5.1 released 1 Feb 2009
 
 * Major code reorganization, making gitit more modular.
diff --git a/Gitit.hs b/Gitit.hs
--- a/Gitit.hs
+++ b/Gitit.hs
@@ -583,7 +583,7 @@
     then do
       key <- newSession (SessionData uname)
       addCookie sessionTime (mkCookie "sid" (show key))
-      addCookie 0 (mkCookie "destination" "")   -- remove unneeded destination cookie
+      addCookie 0 (mkCookie "destination" "/")   -- remove unneeded destination cookie
       seeOther destination $ toResponse $ p << ("Welcome, " ++ uname)
     else
       loginUserForm' page (params { pMessages = "Authentication failed." : pMessages params })
@@ -595,7 +595,7 @@
   case key of
        Just k  -> do
          delSession k
-         addCookie 0 (mkCookie "sid" "")  -- make cookie expire immediately, effectively deleting it
+         addCookie 0 (mkCookie "sid" "-1")  -- make cookie expire immediately, effectively deleting it
        Nothing -> return ()
   seeOther destination $ toResponse "You have been logged out."
 
diff --git a/gitit.cabal b/gitit.cabal
--- a/gitit.cabal
+++ b/gitit.cabal
@@ -1,5 +1,5 @@
 name:                gitit
-version:             0.5.1
+version:             0.5.2
 Cabal-version:       >= 1.2
 build-type:          Simple
 synopsis:            Wiki using HAppS, git or darcs, and pandoc.
@@ -62,6 +62,6 @@
     build-depends:   HAppS-Server >= 0.9.3 && < 0.9.4
     cpp-options:     -D_HAPPS
   ghc-options:       -Wall -threaded
-  cpp-options:       -D_VERSION="0.5.1"
+  cpp-options:       -D_VERSION="0.5.2"
   ghc-prof-options:  -auto-all
 
