I keep getting logged out from sonata admin on the editing page of some specific objects.
it works fine with ROLE_ADMIN but has a problem with my custom defined role.
I had this in config.yml:
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
and I was getting this error:
security.INFO: Populated the TokenStorage with an anonymous Token. [] []
security.DEBUG: Access denied, the user is not fully authenticated;
redirecting to authentication entry point. {“exception”:”[object] (Symfony\Component\Security\Core\Exception\AccessDeniedException(code:
403): Access Denied.
then I changed it to:
session:
handler_id: 'session.handler.native_file'
save_path: '%kernel.root_dir%/sessions/%kernel.environment%'
cookie_lifetime: 259200
gc_maxlifetime: 259200
after I cleared cache, my problem solved in developer mode(app_dev.php), but in production still remains.
Edit: I changed Server API to FPM/FastCGI and still no change.
Try to copy past all the config_dev.yml
in config_prod.yml
and if this is working compare your config_prod.yml
and config_dev.yml
file.
Tags: authentication, phpphp, redirect