• Resolved fatjester

    (@fatjester)


    A highly technical client was asking why his site had an HTTP Response Header with an expiration date in the past, thus preventing browser caching:
    Expires:Thu, 19 Nov 1981 08:52:00 GMT

    I did a little digging, and it turns out “custom sidebars” is the culprit from creating a PHP session.
    I understand creating the session id for logged in users, but is there a reason you are creating it for all users?

    It seems like there would be performance issues preventing browser caching, and possible security issues using session ids over unsecured or unauthenticated connections.

    If there isn’t a reason, could you wrap those sessions in a check if the user is logged in?

    Thanks,
    -Chris

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi Chris,

    Apologies for the delay here.

    Thank you for your detailed report, I’m afraid that I’m unable to clear this up for you much without consulting the developers for further information.

    I will forward this thread to them and get back to you when I get some insight from them.

    Cheers,
    Predrag

    Thread Starter fatjester

    (@fatjester)

    Hello,
    Just checking in on this.

    Thanks,
    -Chris

    Thread Starter fatjester

    (@fatjester)

    Hmm,
    4 weeks without any reply.

    Bummer ??

    -Chris

    Hi Chris,

    Apologies for the delay, our developers are having issues with replicating this and I’m still waiting for further information from them.
    I just pinged them again and hopefully there will be some good news soon.

    Cheers,
    Predrag

    Thread Starter fatjester

    (@fatjester)

    No problem,
    Here are my steps to reproduce.

    1. fresh install of wordpress (I use the default docker container with mariadb)
    2. open site’s mainpage in chrome, open chrome devtools, click network, click the main html file, look at “Headers”, notice under “Response Headers” there is no “Expires” header.
    3. install and activate the “Custom Sidebars” plugin
    4. refresh the site’s mainpage and look at the headers again, notice there is now an “Expires” header set to “Expires:Thu, 19 Nov 1981 08:52:00 GMT”
    5. deactivate the “Custom Sidebars” plugin
    6. refresh the site’s mainpage and look at the headers again, notice the “Expires” header is gone.

    As noted earlier, this is from the plugin creating a php session for all users.
    In php if a session is created, it defaults to expiring the page to prevent sessions from caching.

    Let me know if you have any other questions about replicating the issue.

    Thanks,
    -Chris

    Hi Chris,

    Our developers are currently working on some improvements for this on next release and in the meantime adding below code to your wp-config.php should do the trick:
    define( 'WDEV_USE_SESSION', false );

    Cheers,
    Predrag

    Thread Starter fatjester

    (@fatjester)

    Thanks so much for the update to the plugin!
    Things working great!

    -Chris

    Awesome! Thanks for getting back to us with the status, have a nice day!

    Predrag

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘HTTP Header problem’ is closed to new replies.