the two domain names doamin are different, is there any way to achieve cookie sharing?
Boss solution
the two domain names doamin are different, is there any way to achieve cookie sharing?
Boss solution
just share. Don't think about it.
< H2 > but you can share it indirectly using the iframe method. < / H2 > 1. Now there are two domain names: a.com and b.com
2. Prepare an iframe.html file under the two domain names to manipulate cookie.
3. When operating cookie under the a.com domain name, introduce iframe.html under b.com and transfer the operation of cookie to iframe.html in the form of url suffix.
// a.com
$.cookie('a',1,{domain:"a.com"})
$('body').append('<iframe src="//b.com/iframe.html?type=add&key=a&val=1"></iframe>')
4. Perform the cookie operation under the b.com domain name in iframe.html
// b.com iframe.html
let GetRequest = ()=>{ //...} //url
let {type,key,val} = GetRequest();
if(type=='add'){
$.cookie(key,val,{
domain:'b.com'
})
}
< H2 > Summary: < / H2 >
Next: What is the problem of text overflow caused by vertical arrangement of flex align-items:center?
because vue-router has "- sharp " by default, but when forwarding the address in Wechat s official account, the address "- sharp ", including all future addresses, will be removed directly, resulting in the inability to share the page. so I set the ...
match `~! @-sharp$% ^ & * () _ +-= [] {} |;: ",. < >? these special symbols, how to write regular, always report errors. I don t know what needs to be escaped ....
...