We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2912
    • 315 Posts
    Hi All,

    I have a couple of Modx sites and I keep finding that no matter whether I check "rememberme" after a short period of a couple of days I have to log back in. This happens in both the normal weblogin and the manager.

    I’ve checked as many things as I can but I’m at a loss.

    I logged in using both FF and IE anbd they both exhibit the same issue.

    I do use tabs in FF and sometimes I will log in at the same time with IE. I also log in on different PC’s.

    Any help would be appreciated.
      BBloke
      • 26435
      • 1,193 Posts
      It doesn’t work reliably or at all.

      That is one of the things I fixed in WebLoginPE.
      You can set a cookie with a checkbox (name="rememberme") that, if checked will keep the user logged in until they intentionally log out, at which point the cookie will be deleted. The other option is to have a select named "stayloggedin" witch, in the default WebLoginPE login form looks like
      <select id="wlpeStayLoggedIn" name="stayloggedin">
      	<option value="">No</option>
      	<option value="3600">1 Hour</option>
      	<option value="86400">1 Day</option>
      	<option value="604800">1 Week</option>
      	<option value="2678400">1 Month</option>
      	<option value="315569260">Forever</option>
      </select>


      Depending on what the user selects, WebLoginPE keeps them logged in for that time period (obviously the values are in seconds) or until they intentionally log out in which case the cookie is destroyed.

      -sD-
      Dr. Scotty Delicious, Scientist DFPA.

      I have a demo up at http://demo.scottydelicious.com
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 22303 MODX Staff
        • 10,725 Posts
        Just keep in mind that because PHP sessions are controlled by the server, regardless of how long the cookie lasts, your server-side session storage is going to perform garbage-collection on a specified basis. With typical configurations, the less traffic your web server receives to execute PHP resources, the more often these sessions will be deleted server-side, starting as soon as 20 minutes after being set, by default. If you want to change this, you’ll need to change it at the server level. Unfortunately, most shared-hosting will not allow this, and the only way to achieve these long-lasting sessions is by using a custom session handler that stores it’s sessions in a database or another custom location. This is a feature coming in 0.9.7 by default.
          • 2912
          • 315 Posts
          Thanks for that Scotty I will download and have a look at it. Looks like what would help eliminate the problem. smiley

          I know there are session cookies at the backend which I may have access to via php.ini. Thankfully there is nothing on the site that is required to be viewed whilst logged in but it is a little bugbear when you have to login regularly.

          I’ve popped it on a test page and I get and error:

          Erg: Only for php5.. I’m running v4.4.4 on my dev box and v5.1.6 on hosting services... gonna take some time to implement but thanks for the reply. smiley

          Edit: Upgraded to php5 on development machine.. just wish they would have left the mysql stuff set on default installed!
            BBloke