|
|
@ -11,7 +11,8 @@ namespace StateJobsNYSubmit.Pages |
|
|
|
private readonly ILogger<PrivacyModel> _logger; |
|
|
|
private readonly ILogger<PrivacyModel> _logger; |
|
|
|
|
|
|
|
|
|
|
|
private PrivateData p = new PrivateData(); |
|
|
|
private PrivateData p = new PrivateData(); |
|
|
|
public UserData userData; |
|
|
|
public UserData userData { get; set; } |
|
|
|
|
|
|
|
public string skills { get; set; } |
|
|
|
public SettingsModel(ILogger<PrivacyModel> logger) |
|
|
|
public SettingsModel(ILogger<PrivacyModel> logger) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger = logger; |
|
|
|
_logger = logger; |
|
|
@ -26,13 +27,20 @@ namespace StateJobsNYSubmit.Pages |
|
|
|
{ |
|
|
|
{ |
|
|
|
string test = p.DecryptString(cookieValue); |
|
|
|
string test = p.DecryptString(cookieValue); |
|
|
|
userData = JsonConvert.DeserializeObject<UserData>(test); |
|
|
|
userData = JsonConvert.DeserializeObject<UserData>(test); |
|
|
|
userData.visitCounter++; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData))); |
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData))); |
|
|
|
Console.WriteLine($"Value of counter: {userData.visitCounter}"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
public void OnGet() |
|
|
|
public void OnGet() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
GetUserData(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void OnPost() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GetUserData(); |
|
|
|
|
|
|
|
userData.name = Request.Form["userData.name"]; |
|
|
|
|
|
|
|
userData.email = Request.Form["userData.email"]; |
|
|
|
|
|
|
|
userData.smtpHost = Request.Form["userData.smtpHost"]; |
|
|
|
|
|
|
|
Response.Cookies.Append("PrivateData", p.EncryptString(JsonConvert.SerializeObject(userData))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|