set cookie domain
This commit is contained in:
@@ -94,14 +94,14 @@ builder.Services.Configure<CookiePolicyOptions>(options =>
|
||||
options.CheckConsentNeeded = context => true;
|
||||
//options.MinimumSameSitePolicy = SameSiteMode.Strict;
|
||||
});
|
||||
|
||||
var cookieDomain = builder.Configuration["CookieSettings:Domain"];
|
||||
builder.Services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
//options.Cookie.Name = "GozarAuth";
|
||||
options.Cookie.HttpOnly = true;
|
||||
options.Cookie.SameSite = SameSiteMode.None; // مهم ✅
|
||||
options.Cookie.SecurePolicy = CookieSecurePolicy.Always; // فقط روی HTTPS کار میکنه ✅
|
||||
options.Cookie.Domain = ".dad-mehr.ir"; // دامنه مشترک بین پدر و سابدامینها ✅
|
||||
options.Cookie.Domain = cookieDomain; // دامنه مشترک بین پدر و سابدامینها ✅
|
||||
});
|
||||
|
||||
|
||||
@@ -263,7 +263,13 @@ builder.Services.AddCors(options =>
|
||||
"https://gozareshgir.ir",
|
||||
"https://dad-mehr.ir",
|
||||
"https://admin.dad-mehr.ir",
|
||||
"https://admin.gozareshgir.ir"
|
||||
"https://admin.gozareshgir.ir",
|
||||
"https://api.local.dad-mehr.ir",
|
||||
"https://local.dad-mehr.ir",
|
||||
"https://localhost:7080",
|
||||
"https://api.local.dad-mehr.ir:7080"
|
||||
//"http://localhost:3001",
|
||||
|
||||
)
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
//server
|
||||
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
|
||||
|
||||
|
||||
|
||||
//local
|
||||
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||
@@ -31,7 +31,10 @@
|
||||
"SmsSecrets": {
|
||||
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
|
||||
"SecretKey": "dadmehr"
|
||||
},
|
||||
"CookieSettings": {
|
||||
"Domain": ".local.dad-mehr.ir"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,5 +22,8 @@
|
||||
"faceModels": {
|
||||
"Faces": "c://labels//20//"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"CookieSettings": {
|
||||
"Domain": ".dad-mehr.ir"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
<handlers>
|
||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
||||
</handlers>
|
||||
|
||||
<aspNetCore processPath="dotnet" arguments=".\ServiceHost.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
|
||||
<aspNetCore processPath="dotnet" arguments=".\ServiceHost.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
|
||||
<environmentVariables>
|
||||
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||
</environmentVariables>
|
||||
</aspNetCore>
|
||||
<security>
|
||||
<requestFiltering>
|
||||
<requestLimits maxAllowedContentLength="200000000" />
|
||||
@@ -15,5 +18,4 @@
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
||||
<!--ProjectGuid: 35b6b963-974a-4414-8609-b0668181fa64-->
|
||||
|
||||
<!--ProjectGuid: 35b6b963-974a-4414-8609-b0668181fa64-->
|
||||
Reference in New Issue
Block a user