Created
August 9, 2014 13:18
-
-
Save cwe1ss/674ae2a002cf16f5d2fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IAppCookies | |
{ | |
string UserEmail { get; set; } | |
DateTime? LastVisit { get; set; } | |
} | |
public class AppCookies : IAppCookies | |
{ | |
private readonly ICookieContainer _cookieContainer; | |
public AppCookies(ICookieContainer cookieContainer) | |
{ | |
_cookieContainer = cookieContainer; | |
} | |
public string UserEmail | |
{ | |
get { return _cookieContainer.GetValue("UserEmail"); } | |
set { _cookieContainer.SetValue("UserEmail", value, DateTime.Now.AddDays(10)); } | |
} | |
public DateTime? LastVisit | |
{ | |
get { return _cookieContainer.GetValue<DateTime?>("LastVisit"); } | |
set { _cookieContainer.SetValue("LastVisit", value, DateTime.Now.AddDays(10)); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment