Is it the only way to match the cookie key value corresponding to the specified key name using traditional regular expressions?
怪我咯2017-05-16 13:25:38
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
PHPz2017-05-16 13:25:38
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.