There’s no way, that’s how cookies are stored, piled together, and you can only retrieve them in this way. Regular expression is already a very elegant way. If you want elegant key-value pairs, use localStorage/localSession
In fact, the simplest way is to use the cookie.js library to implement the operation. It is paired with jquery.cookie.js, and its API can be viewed. If you want to write native code, you can define your own functions to solve the problem.
There’s no way, that’s how cookies are stored, piled together, and you can only retrieve them in this way. Regular expression is already a very elegant way.
If you want elegant key-value pairs, use localStorage/localSession
You can only use regular string operations
In fact, the simplest way is to use the cookie.js library to implement the operation. It is paired with jquery.cookie.js, and its API can be viewed. If you want to write native code, you can define your own functions to solve the problem.