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

7
  • Please share your full magento version. Jun 28, 2020 at 7:35
  • my magento version is 2.3.5-p1
    – Mahdi
    Jun 28, 2020 at 7:38
  • Go to the Store > Configuration > General > Web > Session Validation Settings > Use SID on Storefront and set its value to No. Try and let me know. Also make sure you clean the cache & reindex. Jun 28, 2020 at 7:53
  • @AbdulPathan in magento 2.3.5 we dont have SID on Storefront option anymore!
    – Mahdi
    Jun 28, 2020 at 7:57
  • Yes, thats the reason I was assuming somewhere in your database use of SID is set to true. Something is calling addSessionParam() you need to debug full stack trace to see which method calls this function. Jun 28, 2020 at 8:09

1 Answer 1

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!

4
  • 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(); Aug 26, 2020 at 6: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, 2020 at 6:56
  • Thanks, already found the error in my logs, it was caused by a third party module but did not show in the greps Aug 26, 2020 at 10:11
  • One the extensions in my magento use the $sid = $this->sidResolver->getSid($this); How can I correct this? Nov 27, 2020 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.