Magento 2 – How to Remove SID (Session ID) from URL

magento2sessionurl

How to remove the session ID from the URL in Magento 2 (frontend). This is the SID query parameter in the URL.

For example: https://example.com/contact/?SID=sfl317buq8ru4uf4a…

Removed starting from 2.3.3 https://github.com/magento/magento2/issues/25663

Best Answer

Go to the Store > Configuration > General > Web > Session Validation Settings > Use SID on Storefront and set its value to No

example

Here is the good answer about the SID:

The SID is a "session ID". Magento uses this to track a user's activity within the same Magento installation. Normally, Magento powers one website and one store from one installation (database).

Magento could power multiple websites with multiple stores from one installation though. The SID allows users to stay logged in while navigating across these websites/stores.

I think if you have the function enabled, the SID is sent when accessing catalog URLs so Magento can update the session with the user's location/state for the current website/store.

If you're not running a multi-website or multi-store environment, it's safe to disable the SID on the frontend.

Related Topic