This object is in archive! 
Upvote 3

Login - Remember Me functionality

Archived Jennifer B. 11 years ago

Hi there. It seems that the "Remember me for 14 Days" functionality is not working. Is this a configuration issue on my part or a possible bug?

Best Answer
photo

In your case in PHP settings you need to set to 0 or increase the following paramter:

  • session.cache_expire

Also there are parameters in php.ini to pay attention - session.gc_maxlifetime and session.cookie_lifetime

Replies (24)

photo
1

Just an update on this - it works for a little while... (about an hour?)

photo
1

Make sure that you have in application/configs/bootstrap.inc all "lifetime" parameters to be 864000

photo
1

I guess, if you also use Facebook login, Remember me won't work, other than just using standard authentication process. As of now, we can't identify the problem

photo
1

In your case in PHP settings you need to set to 0 or increase the following paramter:

  • session.cache_expire

Also there are parameters in php.ini to pay attention - session.gc_maxlifetime and session.cookie_lifetime

photo
1

Hi Stas. I'm confused about the "official answer" on this topic.

The specific 3 php.ini PHP settings that you mention are the same on both our servers. I just verified them, we have these values set to the standard that comes with PHP.

We have many WordPress installations, and when I login to all of those, I click "remember me" and it remembers me for weeks.

However with UseResponse all our visitors are reporting the same problem we see - I have to login again every time I come to the site.

So I think this is something to fix on the UseResponse side, instead of changing our PHP settings that impact all our WordPress sites too which are already working fine.

Please advise what could be causing this to work fine for WordPress but not for UseResponse. :-)

Thanks!

photo
1

Dan Baritchi wrote:

Hi Stas. I'm confused about the "official answer" on this topic.

The specific 3 php.ini PHP settings that you mention are the same on both our servers. I just verified them, we have these values set to the standard that comes with PHP.

We have many WordPress installations, and when I login to all of those, I click "remember me" and it remembers me for weeks.

However with UseResponse all our visitors are reporting the same problem we see - I have to login again every time I come to the site.

So I think this is something to fix on the UseResponse side, instead of changing our PHP settings that impact all our WordPress sites too which are already working fine.

Please advise what could be causing this to work fine for WordPress but not for UseResponse. :-)

Thanks!

Hi, Dan.

I have tested this one more time again with different browsers and all of them remembering me as I want. Remember me session will close after deleting cookies or if php unable to find session file on server-side. The second case is your case. In ohter words session lifetime is low or system handler forced to clean session directory.

Wordpress uses insecure remembering method that stores current user password hash value in browser cookie. Each time when user reloads blog pages Wordpress checks for this hash variable on clien-side to identify user. This way is insecure because cookies may be stolen and used to login to user's account. Therefore we have refused such method to remember user's login status.

photo
1

Hi Paul. thank you for your answer, but this does not answer my question. :-)

Just to clarify - I understand that it works for you in your test, but that is after you made changes to your php.ini for this.My question is this: our php.ini settings are the standard default that come with Apache/PHP. It works for everything else. For example, how come logging into all my wordpress sites remembers me fine with our current - and default - settings in php.ini on our servers... But with UseResponse I have to change PHP settings for it to remember me?

Thanks!

photo
1

In Wordpress all passwords are stored in cookies hashed, but it's not secure, so we made UR to store password in sessions which is more secure as we value it. You can read some facts for more info about storing passwords in cookies.

In your case, your session is timed out or cleaned due to some environment specifics.So you need to change php.ini settings in order it to work that won't affect anything on your server or other products.

photo
1

Hi Stas!

OK, thank you for the help, sorry to be difficult. :-)

Thanks for the explanation, that's helpful. OK, I requested our web host to change this parameter session.cache_expire to "0".That seemed to help, but did not seem to fix it. I can now login, then close my browser complete, then open it again and I'm still logged in. Also I can go to another site, then come back in an hour, and still logged in. But if I wait a few hours, I am no longer logged in.Is there something else we need to change? You mentioned in official answer a few more php.ini parameters but did not specify what to change them to. Currently here's how they are set, as per Apache/PHP defaults: -----


; After this number of seconds, stored data will be seen as 'garbage' and


; cleaned up by the garbage collection process.


session.gc_maxlifetime = 1440


; Lifetime in seconds of cookie or, if 0, until browser is restarted.


session.cookie_lifetime = 0

photo
1

Dan,

Directive session.cookie_lifetime sould be 1209600 not zero.

Try to change session.cookie_lifetime only if it doesn't help, then try to change session.gc_maxlifetime to 864000.

We have never seen this problem before, you are the first customer with such problem. I think this raises because of non-standard server configuration you are hosted on.

photo
1

Hey Paul.

Great news! After a few days I can confirm this is now working.

  • tried changing session.cookie_lifetime to 1209600 - this did NOT not do it
  • then I changed "session.gc_maxlifetime to 864000 - that did it - WORKS NOW

I am pretty sure our server configuration is standard Apache/PHP. We have 2 servers and both came pre-configured from our web host the same way.

See the reference doc from php.net - both values we had set are the PHP default: http://php.net/manual/en/session.configuration.php

I'm just glad to have it working - You guys may want to have this requirement documented for folks in the future. :-)

photo
1

Dan,

We redefine this parameter in config file, but your hosting doesn't allow that, so this requirement is not strict, and others don't have problems with that, so it's custom situation.

Glad that it worked for you.

photo
1

Understood, thanks so much Stas. And thank you and Paul for your patience and all your help!! :-)

photo
1

Hey Stas!

Could you tell me in what UseResponse config file this parameter is defined in? is it in .htaccess? Don't see it there...

That way I can reach out to my web hosting folks and ask their help to make it work for only this particular website, instead of having to change the server-wide php.ini file.

This didn't really matter before when the UseResponse installs were on their own server, but now that we're migrating the UseResponse installs to our REALLY high traffic server, I want to limit this really high "session.gc_maxlifetime" php setting to just the UseResponse websites if possible. :-)

Thanks!!

photo
1

Hi, Dan.

I guess that "session.gc_maxlifetime" directive changing is not allowed via .htaccess.

If you have access to php.ini on your server try to change "session.gc_maxlifetime" value to 1440 - this is optimized default value in most cases.

Also, I would recomend you not to change "session.cookie_lifetime" to prevent proleptic end of the session.

photo
1

Hey Paul, OK let's figure this out together.

Here's my public_html/.htaccess file for the UR websites - http://www.screencast.com/t/DBeqzBV4cy

Note there is no "session.gc_maxlifetime" in it, no PHP directives at all.

Here's my session settings in the system main php.ini - http://www.screencast.com/t/nyoyOcVz3rOB

I DO know that the UR application is setting some PHP session vars correctly, because the system default for session files is /tmp/, but the UR website session files are being correctly overridden in UR to be in application/sessions/

The problem I'm trying to solve is the very high gc_maxlifetime in the main php.ini, since it applies to all my hight traffic sites too, but we only need it for the UR sites. Regular sites work fine with default 1440 value.

Re: session.cookie_lifetime - should I set this back to "0"? That was one of the first things i tried to fix the UR premature logout from that other support thread. But that didn't fix it - only changing gc_maxlifetime solved the problem. :-)

But I thought that if this value is "0", then if the person logged into the UseResponse website closes their browser, won't they need to login again?

So - please tell me please exactly what to change in the system main php.ini and what to put in any other files specifically for the UR websites, like .htaccess and I'll do it. :-)

photo
1

Dan,

At first apply my suggest on https://help.useresponse.com/responses/huge-number-of-session-files#comment-1339 . Maybe this tip will resolve your problem. If not we will continue to pick up solutions.

photo
1

Quick Update: we've completely rebuilt Remember Me feature in UseResponse 3.0, so it will work without any connection with server PHP settings.

photo
1

Stas, that is wonderful news! we're very excited to see 3.0!!! this is almost as welcome as removing the requirement for that zend encoder a while back. :-) Do you have a tentative planned release date?

photo
1

Hello Dan,

Very hard to give exact date, but we hopefully to launch beta in January-February the latest as we've brought about +100 new features and completely rebuilt core. Now we are working on Knowledge Base.

Beta will be released without mobile interface and API.

photo
1

Hello guys,


Do you know how to implement the keep me logged in functionality in oracle forms

photo
1

Hello Gladys,

Sorry, but we don't know about oracle forms and it's out of UseResponse software

photo
1

Hello guys,


unfortunately I have to post, that "Remember me", the most annoying feature of UR 2.X for full day support, is still there even in a new version of UR 3.1.


I'm running wikipedia, two wordpress instances and one SImpleMachine forum and none of these has any problems with remember a login. So is there anything I can do, to fix this (and I do not have full access to apache server, as my web hosting is just provided space by another company). Thanks

photo
1

Hello Jirka,

We've checked that feature in your community and it works without problems. Could you please provide us the specifics of how can we reproduce the issue?

photo
1

Hmm hard to say how to debug it. At the morning I login and till the evening, I have to login at least five times.


Yesterday, thanks to another issue, I found an possibility to set to Apache server some extra parameters (thanks to .user.ini file). So I've added there two parameters


  1. session.cookie_lifetime = 1209600
  2. session.gc_maxlifetime = 864000

But it seems to have no effect.


I'll try to work tomorrow in a Chrome browser, just to check if Firefox do not have any problems. Thanks. If you'll have any idea how to test it, let me know.

photo
1

So Chrome and also a Safari browser, both login at around 6 AM, now around 8:30 AM, both are already logged out. Any ideas?


If may helps you php.info, here it is http://help.locusmap.eu/phpinfo.php

photo
1

So you login. While lohin you check Remember me. Then close browser. After that open browser and go to the community and you are not logged in?

photo
1

I've tried exactly what you wrote, and this works correctly. Still logged after open of a browser.


I speak about

  • open browser, login and stay on homepage
  • keep browser open and do nothing on a page for at least two hours (maybe less)
  • after that, tap on any topic (for example) and you'll be logged out (in all three browsers I tried). Same experience has my colleague.

On your own web, this works correctly. After whole night when PC was turned off, I'm still logged after reopen of web browser.

photo
2

Thanks for clarification. We'll check that situation. Most likely the problem is with security token check

photo
1

Please, look at the screenshot:

711317fe61d35711c2b4a25049a75986


Probably master value is more essential.


Also I should note that max value for "session.gc_maxlifetime" is 65535. Values bigger than this may cause php session stops working.

photo
1

I was just following Paul's suggestions - https://help.useresponse.com/topic/login-remember-me-functionality#comment-1087


Anyway I'll give this parameter second try with lower value, thanks.

photo
1

Jirka,

Does it work now as expected?

photo
1

Of course no.


Because of your post here https://help.useresponse.com/topic/login-remember-me-functionality#comment-2615 , I do not even expected that this change will work.


Anyway as I wrote somewhere, we are just completely moving (because of these problems) UR on own LAMP server, so I'll give you more info immediately we completely move it. Hopefully tomorrow.

photo
1

We've tried to identify the issue on several environments but couldn't reproduce it, so waiting on your feedback

photo
1

Hello Stas,


so even on a new LAMP server (fresh install, default values), it has exactly same effect as on older web hosting we used before - "Remember me" login do not work, timeout do not happen, but probably only because of default 60 s (now default_socket_timeout: 60, previously if I remember correctly, it was just 30 s). Email still not work as I wrote in different topic.


So feel free to write me how can I help to test these bugs, or feel free to test it on your own.

photo
1

Jirka,

Could you please give us access to changing php.ini parameters, as we think the problem is with php.ini.

photo
1

Hmm because we already host a lot more web sites on our server, I'm not sure if it's good idea to change parameters in php.ini when public web sites are already running.


I see there two alternatives

1. using .user.ini in root of help.locusmap.eu - you should already do this

2. I've attached current php.ini to this post so simply tell me what you needs to change and I'll immediately do it, no problem. In case there will be a problem with other web sites, I'll have possibility to change it back as soon as possible.


Ok?

photo
1

Hello Jirka,

Were you able to resolve the issue with "remember me" on your server?

photo
1

Hello Stas,


after a months of few-times-per-day-login, I get use to it :). Anyway yes, no matter what I changed few weeks ago on our server, this issue still exists.


If you have any idea what should I test, or if you need any information, feel free to write me. I'm currently using help desk on two browsers (chrome, firefox) and both has still this problem.

photo
2

We'll review your php.ini and compare ours, as it's definitely the problem because of server settings.

Will get back to you shortly.

photo
1

Jirka,

Finally we've found the problem and 99% that it will work in your environment after update to 3.1.2 that should be live by tomorrow.

This setting won't be related to server environment and will work universally.

photo
1

this sounds like very good news, thank you!

photo
1

Half day on a new version and no extra login required - issue finally fixed, ahh great!! Thank you. Btw. better and better ... congratulation!

photo
1

Thank you. Glad that it worked for you :)

Replies have been locked on this page!