Post by altego » Sat Jan 04, 2025 11:49 pm

Opencart 4.0.2.3
Everything works perfect on production server.

Need to copy the project to localhost to dev enviroment (xampp).

1) Copy all files to local folder
2) Export/Import DB with phpmyadmin
3) Change pathes in /blablabla/config.php and /config.php (blablabla - the name of admin folder)
4) Delete cach in /storage/cache and /vqmod/vqcache and /vqmod/*.cache

Site works prefect, no problem with layouts, no any php errors/warnings/notices.

I try to login to /blablabla/ area, and can not: after submiting Login form I am redirected to /blablabla/index.php?route=common/login without any error.

The same story is with customer login, - redirecting to login form after submitting customer’s login form.

I truncated oc_sessions and did many other attempts, but I am still not Logged In :)

Help, please.

What this can be?

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by OSWorX » Sun Jan 05, 2025 1:48 am

xpeche wrote:
Sat Jan 04, 2025 11:49 pm
Opencart 4.0.2.3
First bad decision -> this version should not be used currently for production sites (too many bugs).

xpeche wrote:
Sat Jan 04, 2025 11:49 pm
Site works prefect, no problem with layouts, no any php errors/warnings/notices.

I try to login to /blablabla/ area, and can not: after submiting Login form I am redirected to /blablabla/index.php?route=common/login without any error.

The same story is with customer login, - redirecting to login form after submitting customer’s login form.

I truncated oc_sessions and did many other attempts, but I am still not Logged In :)
No error can't be!
Enable all error output and check afterwards the server error logs (not OpenCart's default error.log).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by softmonke » Sun Jan 05, 2025 3:44 am

Do you have a .htaccess file that might be wrongly configured for your localhost?

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by altego » Mon Jan 06, 2025 7:15 pm

OSWorX wrote:
Sun Jan 05, 2025 1:48 am
xpeche wrote:
Sat Jan 04, 2025 11:49 pm
Opencart 4.0.2.3
First bad decision -> this version should not be used currently for production sites (too many bugs).

xpeche wrote:
Sat Jan 04, 2025 11:49 pm
Site works prefect, no problem with layouts, no any php errors/warnings/notices.

I try to login to /blablabla/ area, and can not: after submiting Login form I am redirected to /blablabla/index.php?route=common/login without any error.

The same story is with customer login, - redirecting to login form after submitting customer’s login form.

I truncated oc_sessions and did many other attempts, but I am still not Logged In :)
No error can't be!
Enable all error output and check afterwards the server error logs (not OpenCart's default error.log).
I installed new OC 4 inctance on localhost: all works = > it's not a setting's problem of environment/
I checked all(any) possible errors - OC logs. php logs, all that i can image => now errors or wornings
I turned off all SEO => it's not an .htaccess or related.

Still looking ...

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by altego » Mon Jan 06, 2025 7:19 pm

softmonke wrote:
Sun Jan 05, 2025 3:44 am
Do you have a .htaccess file that might be wrongly configured for your localhost?
turned off any SEO, - no result.

May be, anybody has an idea how to track login proceess?

Looks like that public function login(string $username, string $password) in system/library/cart/user.php is not calling at all.

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by ADD Creative » Mon Jan 06, 2025 7:36 pm

Use you web browser's developer tool to check the login request and response in the network tab. Also check the session cookie is not being reset and is for the correct domain and path.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by altego » Tue Jan 07, 2025 1:08 am

ADD Creative wrote:
Mon Jan 06, 2025 7:36 pm
Use you web browser's developer tool to check the login request and response in the network tab. Also check the session cookie is not being reset and is for the correct domain and path.
Thanks, checked, all is ok with them.

Another abnormal behavior - /blablabla (my /admin) after submiting login forum did not show any msgs (incorrect login, etc). At the same time - show all messages on production site.

May be it cannot download/access from localhost to some third-party script? But dev consol (Chrome) is clean.

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by ADD Creative » Tue Jan 07, 2025 5:36 pm

Check your admin common.js is correctly loading.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by altego » Tue Jan 07, 2025 9:12 pm

ADD Creative wrote:
Tue Jan 07, 2025 5:36 pm
Check your admin common.js is correctly loading.
Thanks, checked.

I've found a way (just a way, this is not a result yet :) )!

Definitely, i have problems with cookies.

When i add a product to the cart, after reloading the page - the cart is empty.

So, it means - i have problems with cookies/session.

====

Some interim result:

1) If i set up a new instanse of OC4, - everything works fine. I can loginf to customer and admin area, can add products to the cart, etc.
2) if i deploy local site from production server, - i cannot login to customer/admin area, the cart is empty after adding products.

I don't believe that XAMPP (i use it for dev environment) - has any problems after instalation from the package.

So, potentially, the problem can be in pathes of something (I don't know yet exactly what).

Of course, my both config.php are checked, so, may be anybody has an idea, where i can look?

Additionally, i found such error in a dev console (see atached).

Attachments

???
cookies.png

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by altego » Tue Jan 07, 2025 10:16 pm

Update:

When i enter http://localhost.dev, i see the OCSESSID in Dev console.
After submiting Customer's login form and redirecting, - there is NO OCSESSID.

When i enter http://localhost.dev/admin - there is NO OCSESSID from the start, even before the submiting form.

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by altego » Tue Jan 07, 2025 10:53 pm

xpeche wrote:
Tue Jan 07, 2025 10:16 pm
Update:

When i enter http://localhost.dev, i see the OCSESSID in Dev console.
After submiting Customer's login form and redirecting, - there is NO OCSESSID.

When i enter http://localhost.dev/admin - there is NO OCSESSID from the start, even before the submiting form.
Ok, i've already fixed that (or not, i dont know exactly):

I changed $_['session_autostart'] to "true"", and now everything works.

But on production server this var is in false.

What is it, dos anybody know?

Pêche à la ligne


Newbie

Posts

Joined
Mon Jul 24, 2023 11:01 pm

Post by abarn » Wed Jan 08, 2025 12:55 am

not sure if related but my admin login fails if I update the SEO URL files from github, only the stock 4.0.2.3 works. If I try and fix it, it locks me out of admin. I have to live with /catalog/controller/startup/seo_url.php errors until the next major update.

New member

Posts

Joined
Fri Aug 12, 2022 10:15 am

Post by ADD Creative » Wed Jan 08, 2025 3:25 am

You might want to clear all the cookies and then check the domains, path and flags in the console. Maybe you have a redirect to https and you config is http or vice versa.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by OSWorX » Wed Jan 08, 2025 9:37 pm

abarn wrote:
Wed Jan 08, 2025 12:55 am
not sure if related but my admin login fails if I update the SEO URL files from github, only the stock 4.0.2.3 works. If I try and fix it, it locks me out of admin.
GitHub files (and I guess you mean the master branch) are NOT for production sites to use or to replace files in an existing installation.
Beside this, there are no SEO-URLs for admin pages.
abarn wrote:
Wed Jan 08, 2025 12:55 am
I have to live with /catalog/controller/startup/seo_url.php errors until the next major update.
About which errors you are talking about ?!

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: gunownergear and 6 guests