1

i get the below error in magento

Exception #0 (Exception): User Deprecated Functionality: Session ID is not used as URL parameter anymore. in /var/www/html/magento.loc/vendor/magento/framework/Url.php on line 763

how can i resolve it? my php version is PHP 7.2.31-1+ubuntu20.04.1+deb.sury.org+1

Mahdi
  • 113
  • 1
  • 4

1 Answers1

9

Hi @Mahdi and other people,

If you have upgraded to Magento >=2.3.5 and one of your third party or custom extensions use one of the functions described above, you'll run into this issue.

In my case, I had previously installed the module veriteworks/cookiefix with the fixed version 1.0.6 (compatible with Magento < 2.3.5). This extension is used to fix the SameSite warnings in browsers. This version would use one of the deprecated functions related to the SID param.

You should look for extensions that use either for:

· getSid function, you can look for usages with:

grep -r "getSid(" vendor
grep -r "getSid(" app/code

· addSessionParam function:

grep -r 'addSessionParam()' vendor
grep -r 'addSessionParam()' app/code

If one of your extensions use these functions, you should remove it/update it/fix it.

Hope this helps!

PauGNU
  • 712
  • 7
  • 18
  • Thanks for the tip, just tried that but only magento modules are showing up

    vendor/magento/framework/Session/SidResolver.php: public function getSid(SessionManagerInterface $session) vendor/magento/framework/Session/SidResolverInterface.php: public function getSid(\Magento\Framework\Session\SessionManagerInterface $session);

    vendor/magento/framework/Url.php: public function addSessionParam() vendor/magento/framework/UrlInterface.php: public function addSessionParam();

    – Sander van Zuidam Aug 26 '20 at 06:23
  • Hey Sander, feel free to contact me directly (twitter in my profile) if you want us to investigate together. I shared this solution because I had the same issue 2 days ago. Then we can share the solution here if we find it :) – PauGNU Aug 26 '20 at 06:56
  • Thanks, already found the error in my logs, it was caused by a third party module but did not show in the greps – Sander van Zuidam Aug 26 '20 at 10:11
  • One the extensions in my magento use the $sid = $this->sidResolver->getSid($this); How can I correct this? – Tassos Voulgaris Nov 27 '20 at 17:25