diff -r 3f0519ce429f modules/ip_login/ip_login.module
--- a/modules/ip_login/ip_login.module	Tue Jun 19 16:54:08 2012 +0200
+++ b/modules/ip_login/ip_login.module	Tue Jun 19 16:54:42 2012 +0200
@@ -555,8 +555,19 @@
   // store whether this user can log back in automatically
   $can_login_as_another_user = _ip_login_can_login_as_another_user($user);
 
+  // retrive uid of the user can login by IP
+  $matched_uid = ip_login_check(ip_address());
+
+  if ($matched_uid != $user->uid) {
+    // in this case user logged by user/passwd would logout and so the system reset cookie to re-enable login by IP
+    $expire = time() - 3600;
+  }
+  else {
+    // in this case user logged by IP would logout and try to login with another user
+    $expire = 0; // Cookie expires at the end of the session (when the browser closes).
+  }
+  
   // sets indicator to behaviour in hook_boot().
-  $expire = 0; // Cookie expires at the end of the session (when the browser closes).
   setcookie(LOGIN_AS_DIFFERENT_USER, $can_login_as_another_user, $expire, '/');
 
   if (!$can_login_as_another_user) {
