When PHP reads Cookie in JSON format, the escape symbol cannot be deleted?

my Cookie goes like this:

cookie={"key":"V0tRTVF=","uid":"2","username":""}

I want PHP to accept these parameters. According to reason, PHP backend to obtain, and then transfer the code can be.

but I find that the value obtained by $_ COOKIE ["cookie"] is as follows:

{\"cookie\":\"V0tRTVF=\",\"uid\":\"2\",\"username\":\"\"}

has been escaped? It doesn"t matter, stripslashes or regular can delete the slash, right?
result-cannot be deleted!

< hr >

[update at 19:09] I just heard the great god tell me that this is just a front-end display problem. In fact, there is no escape character in PHP!
through my tests, direct json_decode ($cookie, true); conversion is fine.
but I still don"t know why the front end will show an extra\. No, no, no.

Mar.23,2021

php directly json_decode ($cookie, true); is that all right?


according to your code test, it is found that the Cookie accepted by the background has not been escaped and there is no "\". When you say there is an extra front end, where does it come from? Do you see it in browser development tools?

Menu