Jump to content

Users keep getting logged out


mike131
 Share

Recommended Posts

Hi,

I initially had Processwire setup on a development server and that was pushed via git to our staging and production servers.

The problems I am now seeing is that sometimes users get logged out after 1 or 2 saves/changes.

I made sure the the folders are owned (CHOWN) by the apache server (based off the httpd.conf user and group).

Please advise.

Link to comment
Share on other sites

mike131 Welcome!

I had a similar issue after running my blog through CloudFlare. Is there any possibility that users' (effective) ip is changing (are they on mobile)? You can easily test/cure by editing /site/config.php

$config->sessionFingerprint = false;

If that cures the problem and you are happy to leave fingerprinting off, fine. If you would prefer the higher security, then find out how/why ips are changing and proceed accordingly. (For CloudFlare, for example, I set no caching on mysite.com/processwire/ in a rule thingy they have.)

Link to comment
Share on other sites

One thing to rule out are the two main php variables that govern garbage collection.

; gc_maxlifetime -- this is a session keep-alive in seconds. php default is 1440, or 24 minutes.

session.gc_maxlifetime = 1440

; gc_divisor -- this will affect the probability of garbage collection executing after gc_maxlifetime has passed, it can make session expiry feel random.

session.gc_divisor = 1000 

You should be able to echo these out with:

printf('session.gc_maxlifetime: %s', ini_get('session.gc_maxlifetime'));

printf('session.gc_divisor: %s', ini_get('session.gc_divisor'));

Link to comment
Share on other sites

@DaveP it looks like that solved it. I changed this setting and it seems to be working so far. I am not 100% sure from the user's standpoint, but since my user's are verified authors. I think it will be okay to leave this off

@Ben I will look into this as well if @DaveP's fix doesn't seem to be it.

  • Like 1
Link to comment
Share on other sites

Have you checked file permission of the assets folder? Should be really high I think. 

(Btw.: I marked this as solved. Feel free to mark as unsolved again if Dave's fix should stop working :) )

Checking the assets folder was my first attempt to resolve.

I had the assets folder and its child directories set to 755

I also made sure the apache server user/group owned those directories as well.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...