How to increase cookie valid login?

  1. 5 years ago

    Hi guys,

    I noticed EsoTalk has a checkbox 'Keep me logged in' which you have to enable in the code. I did this, however it does not seem to work. I can check the checkbox and login but when I close the page and open it I have to login again (aka, it doesn't actually keep me logged in). Is there a way to increase the time of the login cookie? (I think that's what I am looking for?).

    @Martyn Hi guys,

    I noticed EsoTalk has a checkbox 'Keep me logged in' which you have to enable in the code. I did this, however it does not seem to work. I can check the checkbox and login but when I close the page and open it I have to login again (aka, it doesn't actually keep me logged in). Is there a way to increase the time of the login cookie? (I think that's what I am looking for?).

    There are a few config options related to cookies

    From config.defaults.php

    // Cookie settings.
    $config["esoTalk.cookie.name"] = "";
    $config["esoTalk.cookie.domain"] = ""; // Set a custom cookie domain. Set it to .yourdomain.com to have the cookie set across all subdomains.
    $config["esoTalk.cookie.path"] = null; // Set a custom cookie path.
    $config["esoTalk.cookie.expire"] = 2592000; // 30 days

    You should be able to put those into your config to override. The cookie.expire is probably what you're looking for.

    I also found another one though I think it's related to registration? Try setting it to true in your config and see if that helps!

    $config["esoTalk.enablePersistenceCookies"] = false;
  2. @Martyn Hi guys,

    I noticed EsoTalk has a checkbox 'Keep me logged in' which you have to enable in the code. I did this, however it does not seem to work. I can check the checkbox and login but when I close the page and open it I have to login again (aka, it doesn't actually keep me logged in). Is there a way to increase the time of the login cookie? (I think that's what I am looking for?).

    You should just have to refresh the page. If that doesn't work then it's most likely that you have it where your browser deletes all the cookies and cache after it is closed.

  3. Thirtysixway

    17 Nov 2014 Moderator Answer

    @Martyn Hi guys,

    I noticed EsoTalk has a checkbox 'Keep me logged in' which you have to enable in the code. I did this, however it does not seem to work. I can check the checkbox and login but when I close the page and open it I have to login again (aka, it doesn't actually keep me logged in). Is there a way to increase the time of the login cookie? (I think that's what I am looking for?).

    There are a few config options related to cookies

    From config.defaults.php

    // Cookie settings.
    $config["esoTalk.cookie.name"] = "";
    $config["esoTalk.cookie.domain"] = ""; // Set a custom cookie domain. Set it to .yourdomain.com to have the cookie set across all subdomains.
    $config["esoTalk.cookie.path"] = null; // Set a custom cookie path.
    $config["esoTalk.cookie.expire"] = 2592000; // 30 days

    You should be able to put those into your config to override. The cookie.expire is probably what you're looking for.

    I also found another one though I think it's related to registration? Try setting it to true in your config and see if that helps!

    $config["esoTalk.enablePersistenceCookies"] = false;
  4. Edited 5 years ago by Martyn

    @Thirtysixway Thanks a lot! The enablePersistenceCookies setting was indeed what I had to change to true. Now the 'remember login' really works :)

  5. 4 years ago

    @Thirtysixway $config["esoTalk.enablePersistenceCookies"] = false;

    I cant seem to find that specific line, here is what I found so is there anything I should change or add to it?

    // Cookie settings.
    $config["esoTalk.cookie.name"] = "";
    $config["esoTalk.cookie.domain"] = ""; // Set a custom cookie domain. Set it to .yourdomain.com to have the cookie set across all subdomains.
    $config["esoTalk.cookie.path"] = null; // Set a custom cookie path.
    $config["esoTalk.cookie.expire"] = 2592000; // 30 days
  6. [deleted]

    22 Mar 2015

    Just add this to your config. Even if it's not in yours it's safe to add it due it's presence in config.defaults.php.

    $config["esoTalk.enablePersistenceCookies"] = true;
  7. @icecream Just add this to your config. Even if it's not in yours it's safe to add it due it's presence in config.defaults.php.

    $config["esoTalk.enablePersistenceCookies"] = true;

    thanks for the tip

  8. Yeah you can look at it as config.default.php is referenced first, and then your custom config.php is used to override anything that was set in the default file.

  9. @Thirtysixway just bringing this topic back up since this works great for those who were wondering. ;)

 

or Sign Up to reply!