ASP. NET implements multi-domain name multi-site shared Session Value
1. Implementation function: You can set which sites can share the Session value, so as to prevent others from using this to access
To implement this function, you must put the Session value in the database. First, register
The name is as follows: aspnet_regsql.exe-S [database service address]-E-ssadd. For the specific format, refer /?
Aft
AppDomain is a logical container of a set of assemblies. The unique function of AppDomain is to isolate. It is unique in. Net. When creating a hosted application, a default AppDomain will be created at the same time.
Specific AppDomain Functions
1. The object created by the code in one AppDomain cannot be directly accessed by the code in another AppDomain
If you need access, you need to use a proxy, that is, use "by reference to mail" and "by value ma
ASP. NET implements multi-domain name multi-site shared Session Value1. Implementation function: You can set which sites can share the Session value, so as to prevent others from using this to accessTo implement this function, you must put the Session value in the database. First, registerThe name is as follows: aspnet_regsql.exe-S [database service address]-E-ssadd. For the specific format, refer /?After s
1. Modify the Web. config directly, but this is for all Action.Method 2.Add a category with the content shown below:Using system;using system.collections.generic;using system.linq;using system.web;using System;using System.web.http.filters;namespace workflow.filters{Public class Allowcrosssitejsonattribute: ActionFilterAttribute {public override void OnActionExecuted (Httpactionexecutedcontext ActionExecutedContext) { if (actionexecutedcontext.response! = null)
1. The Web. config for two systems is configured as Forms authentication mode (system.web-> authentication node)2. Configure the same system.web-> MachineKey node in the Web. config of both systems (node generation: http://www.aspnetresources.com/tools/keycreator.aspx)3. Configure the same system.web-> httpcookies node in the Web. config for both systems (Two systems using the ASP. NET Forms authentication method for cross-
1. Installer Cors PackageInstall-Package Microsoft.AspNetCore.Mvc.Cors
Typically, the default is with the package's
2. Configure the Cors serviceIn the Startup class, ConfigureServices method, add the following code:services.AddCors(option=>option.AddPolicy("cors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().AllowAnyOrigin()));
Policy names can be customized
3. Configuring Cors MiddlewareIn the Startup class, Configure method, add the followi
Asp. NET implementation of multi-domain multi-site Sharing Session value
1, implementation function: You can set which sites can share session value, so as to prevent others to use this to access
To implement this function, you have to put the session value into the database, all of which we first register with the VS command tool
Named as follows: Aspnet_regsql.exe-s [database service address]-e-ssadd spec
Add the following configuration under the System.webserver node in the Web. config file Httpprotocol> customheaders> Addname= "Access-control-allow-origin"value="*" /> Addname= "Access-control-allow-headers"value="*" /> Addname= "Access-control-allow-methods"value= "GET, POST, PUT, DELETE" /> customheaders> Httpprotocol>C # ASP. NET MVC configuration allows cross-
Statement, the solution is collected from the Internet and collated by individuals. There are others, also have mine.First, Webserive end1.web.configYou need to include the following boldface content in the configuration node of Web. config.Then add the following:2.asm.xIt is unclear whether the following should be added before the class. No time to test.[WebService (Namespace = "http://tempuri.org/")][WebServiceBinding (ConformsTo = wsiprofiles.basicprofile1_1)][System.ComponentModel.ToolboxIte
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.