Sage/Trellis project session expired

I’m using Sage theme in a Ansible project, configured just like the https://github.com/roots/roots-example-project.com.

Problem is that after a couple of minutes or even when trying to save something on wp-admin I get this “Session expired. Please log in again. You will not move away from this page.” message.
It happens a lot and I have to login again.

Also, sometimes I create a new page/post or add a new custom field and it just disappears after a bit.
It looks like it’s not being persisted.

My dev config:

web_user: vagrant

wordpress_sites:
  example.com:
    site_hosts:
      - site.wip
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    repo: git@github.com:roots/bedrock.git
    site_install: true
    site_title: Example Site
    admin_user: admin
    admin_password: admin
    admin_email: admin@example.dev
    multisite:
      enabled: false
      subdomains: false
    ssl:
      enabled: false
    cache:
      enabled: false
      duration: 30s
    system_cron: true
    env:
      wp_home: http://site.wip
      wp_siteurl: http://site.wip/wp
      wp_env: development
      db_name: example_dev
      db_user: example_dbuser
      db_password: example_dbpassword

php_error_reporting: 'E_ALL'
php_display_errors: 'On'
php_display_startup_errors: 'On'
php_track_errors: 'On'
php_mysqlnd_collect_memory_statistics: 'On'
php_opcache_enable: 0

xdebug_install: false
php_xdebug_remote_enable: true
php_xdebug_remote_connect_back: true
php_xdebug_remote_host: localhost
php_xdebug_remote_port: 9000
php_xdebug_remote_log: /tmp/xdebug.log
php_xdebug_idekey: XDEBUG
php_max_nesting_level: 200

Any other plugins being used? Always good to disable them if so and see if the problem persists.

I’d also verify that the cookie is being written for the domain you’re accessing the site on. You can see the cookie domain in Chrome (or any browser’s) dev tools.

Disabled all of my plugins and I’m still having the issue.

Here’s a screenshot of my cookies:

I think it’s “date time” on my vagrant box. It’s set to UTC although I’m on UTC+2.

Edit: Had to set a new date on my vagrantbox and everything seems to be working.

Thanks @swalkinshaw for the help!

The domain there is salitre.wip but your config has http://site.wip. So those don’t match up? They need to.

Yeah I’ve changed it. Sorry for that.

The problem was with the date on the vagrantbox. Not sure why it didn’t setup correctly.
After changing it everything runs ok.

@joaovpmamede FYI, there’s a timezone setting that landed in Trellis yesterday. It will set the system and PHP timezone to the value you define. Maybe that can help you.

Tried changing that value but nothing happened.

Used some values from here: http://php.net/manual/en/timezones.php

This wont work without the latest Trellis. The code underlying was added saturday. Try to pull the latest Trellis, or check if you are at least at commit https://github.com/roots/trellis/commit/f18d68fea6501b9e2180173845209b4489607a9b for the feature to work.