forked from BlogEngine/BlogEngine.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobal.asax
More file actions
28 lines (25 loc) · 858 Bytes
/
Global.asax
File metadata and controls
28 lines (25 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<%@ Application Language="C#" %>
<%@ Import Namespace="BlogEngine.NET.App_Start" %>
<script RunAt="server">
void Application_BeginRequest(object sender, EventArgs e)
{
var app = (HttpApplication)sender;
BlogEngineConfig.Initialize(app.Context);
}
void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
BlogEngineConfig.SetCulture(sender, e);
}
protected void Application_PreSendRequestHeaders ()
{
var httpContext = HttpContext.Current;
if (httpContext != null) {
var cookieValueSuffix = "; SameSite=Strict";
var cookies = httpContext.Response.Cookies;
for (var i = 0; i < cookies.Count; i++)
{
var cookie = cookies[i]; cookie.Value += cookieValueSuffix;
}
}
}
</script>