Post by dcscott » Thu Apr 15, 2021 10:28 pm

I am using opencart 3.0.3.7 for about 2 weeks working on a website. I have logged in many times but after setting the time zone to America/New York I can no longer login. I just get the login screen with no errors. I changed the timezone to UTC in the database and I still cannot login.
There are no errors in my log files.
I changed the cookie code in system/framework.php and also in catalog/controller/startup/session.php which also didn't help.

I changed php.ini to add:
session.cookie_lifetime =360000
session.save_path =/tmp

I changed the admin login and password in the oc_user table. That also didn't help.
There are only a-z,0-9 chars in my user name and password.
Both cache and cookies have been cleared.
Same issue with a different browser.
How do I resolve this and get logged in again?

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by straightlight » Thu Apr 15, 2021 11:06 pm

See this solution about UTC: viewtopic.php?f=201&t=222369&start=20#p817086 .

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Thu Apr 15, 2021 11:17 pm

dcscott wrote:
Thu Apr 15, 2021 10:28 pm
I am using opencart 3.0.3.7 for about 2 weeks working on a website. I have logged in many times but after setting the time zone to America/New York I can no longer login. I just get the login screen with no errors. I changed the timezone to UTC in the database and I still cannot login.
There are no errors in my log files.
I changed the cookie code in system/framework.php and also in catalog/controller/startup/session.php which also didn't help.

I changed php.ini to add:
session.cookie_lifetime =360000
session.save_path =/tmp

I changed the admin login and password in the oc_user table. That also didn't help.
There are only a-z,0-9 chars in my user name and password.
Both cache and cookies have been cleared.
Same issue with a different browser.
How do I resolve this and get logged in again?
If you have tried both suggestions in viewtopic.php?f=201&t=222369&start=20#p816440. Or have tried changing session_engine to file in system/config/default.php. Clearing your browser cache before attempting to login each time.

Then it's probably some change you have made that is now locking you out. For example OpenCart doesn't like session.cookie_lifetime being set to a value other than zero.

www.add-creative.co.uk


Expert Member

Posts

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

Post by dcscott » Fri Apr 16, 2021 1:22 am

I guess I should be more specific:
I tried all the things I mentioned and both of you mentioned.
The timezone IS set to UTC both in the database AND in system/config/default.php
Yes, after the settings made no difference, I set them back to default EXCEPT for leaving the timezone set to UTC.
Still not able to login.

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by dcscott » Fri Apr 16, 2021 1:26 am

Where is session_cookie_lifetime set?

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by dcscott » Fri Apr 16, 2021 1:37 am

Replying to suggestions:
Changing session_engine to file made no difference.
Of course it stopped working because of what I did. I changed the timezone to America/Los Angeles. That is when this happened.

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by ADD Creative » Fri Apr 16, 2021 6:30 am

dcscott wrote:
Fri Apr 16, 2021 1:26 am
Where is session_cookie_lifetime set?
dcscott wrote:
Thu Apr 15, 2021 10:28 pm
I changed php.ini to add:
session.cookie_lifetime =360000
session.save_path =/tmp
In your php.ini going by what you said. Don't set it or set it to 0. See. https://github.com/opencart/opencart/issues/8141

www.add-creative.co.uk


Expert Member

Posts

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

Post by dcscott » Fri Apr 16, 2021 7:45 pm

I tried what the article said even though it was reported as fixed.
Still no luck.
Still cannot login.

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by dcscott » Fri Apr 16, 2021 8:10 pm

I also tried: session.use_cookies = Off
No luck.

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by straightlight » Fri Apr 16, 2021 8:15 pm

Have you tried with .user.ini instead of php.ini file?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dcscott » Fri Apr 16, 2021 9:40 pm

I'm back on.
Here is what I did:
I restored the site from backup then changed config_timezone to UTC.
It let me login.
When I logged off then back on, it did the same thing (wouldn't log me in).
But when I tried logging in again, I got in.
Note: I had done this previously and it didn't work. Because when I make changes and they don't work, I put things back to they way they were and move on to trying something else, the reason none of the other changes worked is because I reverted the config_timezone back to what it was when it didn't work the 1st time. And, yes I cleared the cache and cookies on each trial. Anyway, now I know to not accept the 1st attempt after any change I make.

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am

Post by straightlight » Fri Apr 16, 2021 11:31 pm

dcscott wrote:
Fri Apr 16, 2021 9:40 pm
I'm back on.
Here is what I did:
I restored the site from backup then changed config_timezone to UTC.
It let me login.
When I logged off then back on, it did the same thing (wouldn't log me in).
But when I tried logging in again, I got in.
Note: I had done this previously and it didn't work. Because when I make changes and they don't work, I put things back to they way they were and move on to trying something else, the reason none of the other changes worked is because I reverted the config_timezone back to what it was when it didn't work the 1st time. And, yes I cleared the cache and cookies on each trial. Anyway, now I know to not accept the 1st attempt after any change I make.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dcscott » Sat Apr 17, 2021 12:22 am

An observation:
When the cookie has expired, it takes two attempts to re-login.
It is as if when there is no cookie, it is set then it is found on the subsequent login attempt.
If the code were to set the cookie then immediately requested, the second login attempt would be avoided.

Newbie

Posts

Joined
Fri Mar 12, 2021 3:05 am
Who is online

Users browsing this forum: SohBH and 268 guests