When trying to log in to the OpenCart admin panel (/admin
), the page refreshes without logging in.
- No error messages appear, but you return to the login page after submitting credentials.
- You cannot access the admin dashboard.
- Sometimes, incorrect session handling or cookie issues cause this.
1. Clear Browser Cache & Cookies
2. Check
config.php
for Incorrect Paths/admin/config.php
.define('HTTP_SERVER', 'https://yourdomain.com/admin/');
define('HTTPS_SERVER', 'https://yourdomain.com/admin/');
3. Fix Sessions & Cookies in
config.php
/admin/config.php
:ini_set('session.cookie_httponly', 1);
ini_set('session.use_strict_mode', 1);
ini_set('session.cookie_secure', 1); // Set to 0 if not using HTTPS
4. Manually Clear OpenCart Sessions
rm -rf system/storage/session/*
TRUNCATE TABLE oc_session;
5. Disable SSL Temporarily in the Database
UPDATE oc_setting SET value = '0' WHERE key = 'config_secure';
6. Reset Admin Password (If Needed)
UPDATE oc_user SET password = SHA1('newpassword') WHERE username = 'admin';
7. Check
.htaccess
for Redirect Issues.htaccess
file is misconfigured, which may prevent login..htaccess
and try again.8. Disable Extensions That May Interfere
UPDATE oc_modification SET status = 0 WHERE name LIKE '%security%';
9. Restart the Web Server & Try Again
service apache2 restart # For Apache
service nginx restart # For Nginx
10. Check Error Logs for Clues
/system/storage/logs/error.log
/var/log/apache2/error.log
(Apache) or/var/log/nginx/error.log
(Nginx)Comments:
This issue is often caused by incorrect session settings, cookies, or URL misconfiguration. If you still can’t log in, try restoring a working backup of your
config.php
. 🚀