Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: renderwarrior on December 07, 2009, 12:37:39 PM

Title: Remember me doesn't woirk anymore
Post by: renderwarrior on December 07, 2009, 12:37:39 PM
Hi!
I'm using Roundcube + the MyRoundCube plugins + hMailserver + win2008 server Web Edition.
I'm using the "remember_me" plugin, but since the v. 1.1 it doesn't work anymore (it seems it doesn't create the cookie).
I used the v.1.0 and it works nice (hoping it will not break anything)

Can you help me please with the v.1.1?
Thanks!!

PS: GREAT PIECE OF SOFTWARE!!!
Title: Remember me doesn't woirk anymore
Post by: rosali on December 08, 2009, 09:55:52 AM
Found the bug ... update the following piece of code:

  function login_after($args) {
    if (($_POST['_rememberme'] == 1) && !empty($_POST['_user']) &&  !empty($_POST['_pass'])) {
       setcookie ('rememberme_user',$this->encode(trim($_POST['_user'])),time()+60*60*24*365);
       setcookie ('rememberme_pass',$this->encode(trim($_POST['_pass'])),time()+60*60*24*365);
       setcookie ('rememberme_host',$this->encode($_SESSION['imap_host']),time()+60*60*24*365);
       setcookie ('rememberme_checked',1,time()+60*60*24*365);
    }
    return $args;
  }
Title: Remember me doesn't woirk anymore
Post by: capp on December 15, 2009, 07:44:54 PM
Seems as remember_me does not work for hosts with SSL connection, as $host does not include the SSL parameters.

If I understand it correct, you have to save $imap_ssl and $imap_port in cookies as well to get your session resumed.