Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session blocking doesn't work in the admin panel #11190

Open
simonworkhouse opened this issue Nov 28, 2024 · 2 comments · May be fixed by #11191
Open

Session blocking doesn't work in the admin panel #11190

simonworkhouse opened this issue Nov 28, 2024 · 2 comments · May be fixed by #11191

Comments

@simonworkhouse
Copy link
Contributor

Bug description

The admin panel throws an error when session blocking is enabled, see https://laravel.com/docs/11.x/session#session-blocking

[2024-11-28 09:40:33] local.ERROR: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given {"exception":"[object] (TypeError(code: 0): call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given at /var/www/statamic-cms/statamic/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:304)

I'd suggest that some of the blame lies with Laravel as the Illuminate\Session\SessionServiceProvider is responsible for attaching a Illuminate\Contracts\Cache\Factory instance but it only does this on the Illuminate\Session\Middleware\StartSession middleware specifically (in Illuminate\Session\SessionServiceProvider and hence it's missed from Statamic\Http\Middleware\CP\StartSession.

How to reproduce

Enable session blocking with the config session.block set to true and proceed to the admin panel.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.34.2
PHP Version: 8.2.26
Composer Version: 2.8.2
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.41.0 Solo

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

Enable session blocking with the config session.block set to true and proceed to the admin panel.

I don't see the session.block config option mentioned in the docs. Where did you see it?

@duncanmcclean
Copy link
Member

Anyways, I've opened a PR which should fix this for you. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants