Grant access to gated content Sitecore webforms for marketers
public class GrantGatedAccess : WffmSaveAction | |
{ | |
public override void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext = null, | |
params object[] data) | |
{ | |
HttpCookie cookie = new HttpCookie(Constants.GatedAccessCookeName) | |
{ | |
Value = Constants.AccessGrantedCookieValue, | |
Expires = DateTime.Now.AddDays(Utility.GetCookieLifeSpan()) | |
}; | |
HttpContext.Current.Response.Cookies.Add(cookie); | |
} | |
private Utility _utility; | |
public Utility Utility | |
{ | |
get | |
{ | |
if (_utility == null) | |
{ | |
_utility = new Utility(); | |
} | |
return _utility; | |
} | |
set { _utility = value; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment