Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdminSessionsManager and AdminSessionInfo - strtotime issue fix for admin login PR #34514

Merged

Conversation

kanhaiya5590
Copy link
Contributor

@kanhaiya5590 kanhaiya5590 commented Nov 3, 2021

Description (*)

  • TypeError: strtotime() expects parameter 1 to be string, int given ...security/Model/AdminSessionsManager.php:338
  • TypeError: strtotime() expects parameter 1 to be string, null given in ...security/Model/AdminSessionInfo.php:136

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes M 2.4.3-p1 - TypeError in AdminSessionsManager.php:338 (strtotime() expects parameter 1 to be string, int given) #34415
  2. Fixes Backend throws PHP Fatal TypeError when session storage is empty #34531

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

…g, null

main.CRITICAL: TypeError: strtotime() expects parameter 1 to be string, null given in ...security/Model/AdminSessionInfo.php:136
…dminSessionsManager.php(338)

TypeError: strtotime() expects parameter 1 to be string, int given
magento#28 /var/www/share/meevo.io/releases/66/vendor/magento/module-security/Model/AdminSessionsManager.php(338):
@m2-assistant
Copy link

m2-assistant bot commented Nov 3, 2021

Hi @kanhaiya5590. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added the Severity: S1 Affects critical data or functionality and forces users to employ a workaround. label Nov 3, 2021
@kanhaiya5590
Copy link
Contributor Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @kanhaiya5590. Thank you for your request. I'm working on Magento instance for you.

@Den4ik
Copy link
Contributor

Den4ik commented Nov 3, 2021

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@kanhaiya5590
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@m2-community-project m2-community-project bot added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Nov 4, 2021
Signed-off-by: Denis Kopylov <[email protected]>
Signed-off-by: Denis Kopylov <[email protected]>
@Den4ik
Copy link
Contributor

Den4ik commented Nov 4, 2021

@magento run all tests

@lytesaber
Copy link

I see this is being merged into 2.4-develop branch however this problem also the affects 2.3.7-p2 release are we going to get a patch for the 2.3.x release line as well? Currently we're having to ask clients to clear their cookies to be able to access the admin panel of their stores due to this error.

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev
Copy link
Contributor

@sidolov, how can we convert this PR to a patch to 2.3.7-p2?

@kanhaiya5590
Copy link
Contributor Author

HI @ihor-sviziev

Every pull-request on GH can be downloaded as a beautiful mail-patch, just by appending ".patch" to the PR URL

https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/34514.patch

This will generate a mail-formatted patch file, that is a little different from an usual patch file: It has e-mail metadata.

After downloaded, apply the result patch using:
$ git am 34514.patch

Hope this is what patch you looking for.

or PR diff -> https://patch-diff.githubusercontent.com/raw/magento/magento2/pull/34514.diff

@Den4ik
Copy link
Contributor

Den4ik commented Nov 10, 2021

@sidolov, how can we convert this PR to a patch to 2.3.7-p2?

Similar as cookie patch. I made PR manually. @kanhaiya5590 Could you prepare PR to 2.3-release branch?

@magento-engcom-team
Copy link
Contributor

Hi @Den4ik, thank you for the review.
ENGCOM-9336 has been created to process this Pull Request

@kanhaiya5590
Copy link
Contributor Author

Hi @Den4ik
Created a PR for Magento v2.3 #34606

@ihor-sviziev
Copy link
Contributor

@kanhaiya5590, yeah, I know, the question was about creating the quality patch for magento 2.3.7-p2

@ihor-sviziev
Copy link
Contributor

Hi @kanhaiya5590,
It looks like this issue isn't reproducing on clean Magento installation. Could you provide some steps to reproduce it?

@DannyDaemonic
Copy link

I just ran into issue #34415. Applying this PR (#34514) resolved the problem.

@ihor-sviziev I apologize if this isn't productive, as I can't say the exact steps, but it seems it was at least partially triggered by logging in from a different system and ip address without first logging out of my previous session. When I went back to the system I was previously logged in to, I ran into the issue.

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Preconditions:

  1. Have Magento latest installed

Manual testing scenario:

  1. Update the code as shown in below screenshot.

Screenshot 2021-12-27 at 2 29 44 PM

  1. Try to login as an Admin from UI.

Before: ✖️ Getting an typeError:

Screenshot 2021-12-27 at 2 29 55 PM

After: ✔️ Able to see the values in the response

Since it is a specific case were code changes are involved, no additional regression is required on this!

@kanhaiya5590
Copy link
Contributor Author

Hope this PR is ready to merge.

FYi - @ihor-sviziev @engcom-Alfa @Den4ik

magento-devops-reposync-svc pushed a commit that referenced this pull request Feb 1, 2022
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit fd191fe into magento:2.4-develop Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Security Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: accept Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
None yet