Skip to content

[BUG] Sessions disappear after restarting container or server #257

Closed
@Montg0mery

Description

@Montg0mery

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Previously, stopping and starting the container kept user sessions alive if they hadn't yet expired. Now, stopping and starting the container means that everyone has to log in again. We have servers that reboot every night which now means everyone has to log in every day, whereas before they didn't (their session would last for the length specified in the config, e.g. 28 days or whatever it is set to).

Could this be caused by the new line:

rm -rf /config/www/framework/{cache,sessions,views}/*

In this commit? 476e046#diff-909a1ebff03d259136ec01cd7db25422ae0d176fdfcecad6d83456a4c1cdccb2R11

That would match up roughly with when we started noticing this problem.

I can understand clearing sessions on a container rebuild / version upgrade, but not just on stopping and starting the container.

Expected Behavior

Sessions don't disappear just because the container has stopped and started.

Steps To Reproduce

  1. Log in to BookStack
  2. Stop the container
  3. Start the container
  4. Refresh the BookStack page
  5. Observe that you need to log in again

Environment

  • OS: Ubuntu 20.04 LTS
  • Docker: 27.4.1 (from official Docker apt repos)
  • Docker Compose: 2.32.1 (now using Docker's internal docker compose)

CPU architecture

x86-64

Docker creation

We use linuxserver/bookstack:latest as the image in Docker Compose and have a persistent volume for /config. We updated the image recently with docker compose pull and docker compose up -d which is when we started noticing the issue (after the first container restart overnight). The containers are restarted just with docker compose stop and docker compose start.

Container logs

bookstack  | [14-Jan-2025 04:02:10] NOTICE: PHP message: PHP Warning:  PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0
bookstack  | [migrations] started
bookstack  | [migrations] 01-nginx-site-confs-default: skipped
bookstack  | [migrations] 02-default-location: skipped
bookstack  | [migrations] done
bookstack  | usermod: no changes
bookstack  | ───────────────────────────────────────
bookstack  | 
bookstack  |       ██╗     ███████╗██╗ ██████╗
bookstack  |       ██║     ██╔════╝██║██╔═══██╗
bookstack  |       ██║     ███████╗██║██║   ██║
bookstack  |       ██║     ╚════██║██║██║   ██║
bookstack  |       ███████╗███████║██║╚██████╔╝
bookstack  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
bookstack  | 
bookstack  |    Brought to you by linuxserver.io
bookstack  | ───────────────────────────────────────
bookstack  | 
bookstack  | To support LSIO projects visit:
bookstack  | https://www.linuxserver.io/donate/
bookstack  | 
bookstack  | ───────────────────────────────────────
bookstack  | GID/UID
bookstack  | ───────────────────────────────────────
bookstack  | 
bookstack  | User UID:    1000
bookstack  | User GID:    1000
bookstack  | ───────────────────────────────────────
bookstack  | Linuxserver.io version: v24.12.1-ls186
bookstack  | Build-date: 2025-01-05T10:11:29+00:00
bookstack  | ───────────────────────────────────────
bookstack  |     
bookstack  | using keys found in /config/keys
bookstack  | **** The following active confs have different version dates than the samples that are shipped. ****
bookstack  | **** This may be due to user customization or an update to the samples. ****
bookstack  | **** You should compare the following files to the samples in the same folder and update them. ****
bookstack  | **** Use the link at the top of the file to view the changelog. ****
bookstack  | ┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
bookstack  | │  old date  │  new date  │ path                                                                   │
bookstack  | ├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
bookstack  | │ 2018-03-06 │ 2024-07-16 │ /config/nginx/site-confs/default.conf                                  │
bookstack  | │            │ 2024-12-17 │ /config/nginx/nginx.conf                                               │
bookstack  | │ 2022-08-05 │ 2024-12-06 │ /config/nginx/ssl.conf                                                 │
bookstack  | └────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
bookstack  | Waiting for DB to be available
bookstack  | PHP Warning:  PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0
bookstack  | 
bookstack  |    INFO  Nothing to migrate.  
bookstack  | 
bookstack  | [custom-init] No custom files found, skipping...
bookstack  | [15-Jan-2025 04:02:40] NOTICE: PHP message: PHP Warning:  PHP Startup: Invalid date.timezone value '', using 'UTC' instead in Unknown on line 0
bookstack  | [ls.io-init] done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions