'How can I disable Cookie Value Prefix in my Laravel apps

I am using multiple laravel version like 6.x, 8.x in my local machine.

In all my laravel apps I observed that laravel is appending encrypted cookie key name in cookie value.

https://github.com/laravel/framework/blob/00fa9c04aed10d68481f5757b89da0e6798f53b3/src/Illuminate/Cookie/CookieValuePrefix.php

for example if my cookie name is laravel_session and cookie value is xyz then laravel is adding laravel_sessionv2|xyz in the cookie value after encrypting it.

something like e8617029d2d9cf4ea049a140afea94c6af4a5aa3|1jQEpznJy64PVNSOgPKClzhLMUj4gn34zRRpwdW9

here's a sample that I created at Cyberchef https://gchq.github.io/CyberChef/#recipe=HMAC(%7B'option':'Base64','string':'5Q6/BDLAS2MF0fN9FmMvkSuEvC71P%2BnvwkXw/jzvbUo%3D'%7D,'SHA1')&input=bGFyYXZlbF9zZXNzaW9udjI

This is common in all my Laravel apps. But in my peers machine they are not getting such prefix. they have only cookie value but without prefix. We all are using same source code but somehow only I am getting the prefix.

this leads me to the question How can I disable it in my machine.

The same question was asked before on SO but didn't answered how to disable it

Extra string & pipe character in Laravel Cookies



Solution 1:[1]

I solved this by upgrading my laravel/framework version to 6.20.44. enter image description here

If this didn't solve your problem then tell me something :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vinicius Silva