OSDN Git Service

fix logout function of $cookie-login.
authorvisor <visor@users.sourceforge.jp>
Thu, 15 Apr 2010 15:02:48 +0000 (00:02 +0900)
committervisor <visor@users.sourceforge.jp>
Thu, 15 Apr 2010 15:02:48 +0000 (00:02 +0900)
modules/ml-cookielogin.cc

index 77ef897..feae496 100644 (file)
@@ -275,6 +275,15 @@ MNode*  ml_cookielogin_logout (MNode* cell, MlEnv* mlenv, MLFunc* mobj) {
     if (rc == 2) {
        obj->db.del (id);
     }
+    if (! isHTTPS ()) {
+       ustring  key2 (obj->sessionkey);
+       key2.append (CharConst ("N"));
+       key = mlenv->env->http.readCookie (key2);
+       if (obj->db.get (key, key2)) {
+           obj->db.del (key2);
+       }
+       obj->db.del (key);
+    }
     obj->closedb ();
 
     return NULL;