禾润坊创伤疤痕平复膏,商场打折,省钱屋
比如 http://www.test.com 和 http://m.test.com
简单粗暴的方法 web.config
<system.web>
<!--其他配置 省略……-->
<httpcookies domain="test.com" /><!--同一顶级域名-->
</system.web>
<handlers>
<!--其他配置 省略……-->
<!--<remove name="optionsverbhandler" />--><!--这里一定得要注释掉optionsverbhandler。意思允许支持 options -->
</handlers>
<httpprotocol>
<!--其他配置 省略……-->
<customheaders>
<add name="access-control-allow-origin" value="*" /><!-- * 允许所有 或者 http://www.test.com 允许指定的地址-->
<add name="access-control-allow-credentials" value="true" /><!--允许携带cookie-->
<add name="access-control-allow-methods" value="get, head, options, post, put" />
<add name="access-control-allow-headers" value="cache-control,content-type,if-modified-since,origin,x-requested-with,content-language" /><!--header支持的都填入,不够的继续添加-->
</customheaders>
</httpprotocol>
//原生请求方式: var xhr = new xmlhttprequest(); xhr.withcredentials = true; //jquery 请求方式 $.ajaxsetup({crossdomain: true, xhrfields: {withcredentials: true}});
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论