Hello All,
I have a scenario that I'm hoping someone has come across. In the Magento admin, when I enter a customer edit page, I am quietly logged out during the various Ajax processes.
An example of the Ajax call that triggers this is:
It's supposed to return a JSON value along the lines of:
Instead it returns this:
Of course, any subsequent clicks on the site sends me back to the login page.
I don't see anything obvious in the logs that would explain this. Has anyone encountered anything like this?
Thanks.
Hello @jhaskinshc4966
Check Magento Session Configuration:
Verify Session Storage: Open app/etc/env.php.
Check the session configuration under the session key:
Clear Sessions:
If the session storage is files, delete old session files:
rm -rf var/session/*
Cookie Domain and Path:
Update Cookie Settings:
Go to Stores > Configuration > General > Web.
Expand the Default Cookie Settings section.
CSRF Token Validation:
Increase Admin Session Lifetime:
Go to Stores > Configuration > Advanced > Admin > Security.
Set Admin Session Lifetime (seconds) to a higher value, e.g., 86400 (24 hours).
Hope it helps !
If you find our reply helpful, please give us kudos.
A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
WebDesk Solution Support Team
Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Location: 150 King St. W. Toronto, ON M5H 1J9
It could be due to session management issues. First, check the Max Session Size in Admin setting, as Magento 2.4.4 enforces stricter session size limits. If set to 0, it can cause session terminations. Run the command bin/magento config:set system/security/max_session_size_admin 2560000 and flush the cache to fix it.
Next, ensure that session storage is correctly configured in app/etc/env.php, as misconfigured storage can lead to session inconsistencies. If AJAX requests return unexpected HTML instead of JSON, this might indicate session expiration or controller misconfiguration, so ensure proper JSON responses are handled.