<기능개선>

--
http 관련 개선
This commit is contained in:
kdh0120 2021-11-10 23:43:11 +00:00
parent 760e82feb1
commit 559e3e22ad
2 changed files with 27 additions and 7 deletions

View File

@ -28,7 +28,8 @@ namespace NP.BO.Controllers
ViewBag.IsSubAdmin97 = SUserInfo.IsSubAdmin97;
//로그인을 위해서 다 https로 돌림
if (!Request.IsSecureConnection && GetConfig("usessl") == "Y")
if (!Request.IsSecureConnection && GetConfig("usessl") == "Y"
&& (!Request.Url.AbsolutePath.ToUpper().StartsWith("/ACCOUNT/")))
{
filterContext.Result = new RedirectResult("https://" + Request.Url.Host + Request.Url.PathAndQuery);
}

View File

@ -41,6 +41,19 @@ namespace NP.Base
public const String SUIFCROOM = "NPTECHSUIFCROOM";
public const String SUIFTCROOM = "NPTECHSUIFTCROOM";
private const String SUIDATE = "190517";
private bool? securev = null;
private bool IsSecure
{
get
{
if(securev == null)
{
securev = GetConfig("usessl") == "Y";
}
return securev.Value;
}
}
public NP.Model.SSUserInfo SUserInfo = new Model.SSUserInfo();
public void SSClear()
@ -913,13 +926,19 @@ namespace NP.Base
SUserInfo.UserInfo + "$" +
SUserInfo.LoginKey + "$" +
DateTime.Now.ToString("yyMMddHHmmss") + "$" +
SUserInfo.LoginIP) + ";SameSite=None");
c.Secure = true;
c.HttpOnly = true;
SUserInfo.LoginIP) + (IsSecure ? ";SameSite=None" : ""));
if (IsSecure)
{
c.Secure = true;
c.HttpOnly = true;
}
Response.Cookies.Add(c);
var c2 = new System.Web.HttpCookie(TopMenuNo == 1 ? SUIT : SUIFT, EncString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")) + ";SameSite=None");
c2.Secure = true;
c2.HttpOnly = true;
var c2 = new System.Web.HttpCookie(TopMenuNo == 1 ? SUIT : SUIFT, EncString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")) + (IsSecure ? ";SameSite=None" : ""));
if (IsSecure)
{
c2.Secure = true;
c2.HttpOnly = true;
}
Response.Cookies.Add(c2);
if (isFront)
{