Keep getting logged out of Wordpress admin session.

6 replies
Hi, I'm working on 45 blogs at once (part of a farm I'm building). The problem I'm having is that when logged in as the admin by the time I visit all the blogs and implement one change I have to re-login because my session has expired. My "session" seems to last only a few minutes.
Session expired. Please log in again. You will not move away from this page.
I've been searching for days (and days) and putting up with it for weeks (and weeks) but I can't find a solution. I guess that normally people just accept it and log back in but I'm spending half my freaking day logging back in!

I've cleared all cookies and reset my home and site URLs numerous times. Apparently going from http:// to http://www. can clear the cookies. The session typically is lasting for only 5 minutes or so. Sometimes it feels like a lot less.

Is there a location somewhere that tells Wordpress how to long to wait in idle mode before it logs you out of the session? It's doing my head in and I'm wasting too much time both on logging in constantly (if nothing else, it interrupts my flow 45 x 10 times a day) and researching this problem. Others are having it and it seems to be something related to one of the recent versions.

I'm stuck, any suggestions appreciated.
#admin #logged #session #wordpress
  • Profile picture of the author KateHunter
    Sounds annoying. Your webhost is not able to help? Is the network set up as wordpress multisite?
    {{ DiscussionBoard.errors[9079577].message }}
  • Profile picture of the author Mr Bill
    Individual blogs on sub domains of the same domain.
    {{ DiscussionBoard.errors[9079585].message }}
  • Profile picture of the author KateHunter
    Hmm Why are your subdomains eating your cookies??
    I guess you already checked in wp_set_auth_cookie located in wp-includes/pluggable.php
    Or unusual code in your themes function.php, or plugins code or your server settings?
    {{ DiscussionBoard.errors[9079627].message }}
  • Profile picture of the author RobinInTexas
    Best to create a child theme before editing theme files.

    Try placing this code in the functions.php file
    PHP Code:
    // add to functions.php
    function change_wp_cookie_logout(  ) {
    return 
    15552000// 6 months in seconds
    }
    add_filter'auth_cookie_expiration''change_wp_cookie_logout' ) ; 
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[9080028].message }}
  • Profile picture of the author Mr Bill
    Thanks Kate, not sure what I should be looking for or what to do in pluggable.php

    Thanks Robin, I've tried that (one of the many things I tried before asking for help) - no difference. In fact last night I did a whole heap of testing. I created three goups of 5 websites each.

    1) a control group with untouched settings (as they currently are with short time outs),

    2) another group with all plugins removed (renamed plugins folder to pluginsold)

    3) and a third group with that code added just above the close php statement in the functions.php.

    I closed all my browsers and cleared all cookies from the installed domain (but kept the window open to see what cookies are placed as I logged in (a very interesting experience). They all cut my sessions short.

    Then I removed the theme (replaced with twenty fourteen) in the two mod groups (no plugins and with that code in the functions.php) and the short time outs stopped.

    This tells me that it's not any of the plugins and adding that code doesn't help but that the theme must be the cuplrit. I'm using Gazette theme on all sites. This would explain why there's not much about short time out sessions. It must be a very specific issue with just my installs or I've done something in all my copying and pasting to make some kind of hybrid demon theme.

    I want to start with a fresh install, but I'm not about to totally rebuild 45 websites by manually typing in all the content again so there must be some conflict somewhere. I may have used the same files from one install copied across to all the other installs (to aid consistency across all sites which I'm about to release to members).

    It's cost me a days and days of wasted time - so frustrating. I could actually just sit here all day endlessly logging into every site then going back to the first which by then I'd have to log back into and do the whole login process again. When building so many similar sites (different topics) the only way to move through all the work is to have them all open at once and go from tab to tab performing a single operation or modification.

    This current problem makes that almost impossible so I'm really looking for a fix. I've tried paying a guy who was a super expert but well...that didn't end well.
    {{ DiscussionBoard.errors[9081247].message }}
  • Profile picture of the author KateHunter
    Ha ha, demon hybrid theme. So you activated your plugins so you know it was the theme now? Knowing you, I'm sure you wouldn't have pasted anything wrong. Sounds like you are just about to figure out the mystery, or get a new theme. Good luck bug hunting.
    {{ DiscussionBoard.errors[9082478].message }}

Trending Topics