How to change an existing Cookie

Cookie changes also need the help of Response-Header Set-Cookie field, but it needs to be noted that: the cookie to be modified key / domain / path / secure must be exactly the same, otherwise it will generate the same but different attributes of two names cookie , As follows: 

1. Normal modify cookie

Set-Cookie: key1=value1; domain=example.com; path=/blog
Set-Cookie: key1=value2; domain=example.com; path=/blog

 

2. Generate the same name two cookie

Set-Cookie: key1=value1; domain=example.com; path=/blog
Set-Cookie: key1=value2; domain=example.com; path=/

 

Guess you like

Origin www.cnblogs.com/aisowe/p/11565993.html