Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cwe1ss
Created August 9, 2014 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwe1ss/674ae2a002cf16f5d2fa to your computer and use it in GitHub Desktop.
Save cwe1ss/674ae2a002cf16f5d2fa to your computer and use it in GitHub Desktop.
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