The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Early timeout for logged in user
#1
Hello!

First, congratulations for such a wonderful user management system. This helps my project a great deal.

I am encountering an issue with a logged in user timing out early. I have set up UserSpice as follows:

Linux / Ubuntu 16.04 w/ Nginx and PHP 7
UserSpice is installed in a subdirectory
I am able to successfully login as a user

Once I log in with that user, it automatically logs out the user after about one minute no matter what I do. It then makes me log back into the system. This happens even with the administrator account. I have double checked the Cookie timeout and it is set at the default one week. Any ideas for fixing this?

Thanks!
  Reply
#2
Thanks for the compliments. We've used both PHP7 and NginX but I'm trying to think if we've used them together. Do you have any way to set your system to 5.6 and see if the same thing happens?

That is a very weird problem. Does it still happen if you check the remember me box on login?
  Reply
#3
You can also try adding these two lines before session_start() in the users/init.php file.

I'd love to know if that makes a difference.

Code:
ini_set('session.gc_maxlifetime', 3600);
Code:
session_set_cookie_params(3600);

So your first 4 lines would be...
Code:
<?php
Code:
ini_set('session.gc_maxlifetime', 3600);
Code:
session_set_cookie_params(3600);
Code:
session_start();
  Reply
#4
I wasn't expecting a reply so quickly. Thanks for your A+ service.

Your suggestion to "remember me" made the difference.

Thanks again!!
  Reply
#5
Glad I could help...but there is still some other configuration issue on your server. The remember me sets a cookie...so if you are still staying logged in, that's great, but that means there is some sort of session issue on your server. I would try to...
1. Logout.
2. Add this line to init.ini
ini_set('session.gc_maxlifetime', 3600);
3. Login without remember me and see if your problem is still there.

If the problem goes away, you can either leave that line there, or you might want to adjust the php.ini file to have htat maxlifetime thing there so you don't keep getting logged out on other apps.
  Reply
#6
I tried the second set of changes you recommended. I added the lines to init.php. However, the error recurs with this and the user gets timed out after one minute. I have confirmed that my server php.ini is properly set up and that cookies there are at least 3600 seconds long before expiration.
  Reply
#7
Hmm. That's very weird. I'll have to do some looking at that. Obviously you can set the remember me by default on login as a temporary solution.
  Reply
#8
And here is one other interesting tidbit. There is no expiration in Safari. This problem occurs only in Chrome.
  Reply
#9
Hmm. Yeah. That makes me think it is not server side... if it is on a live server, I would try accessing from another computer. I wonder if it is a chrome extension or something.
  Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)