-
-
Save islaytitans/d36c3c5dbe187884812598e90b641391 to your computer and use it in GitHub Desktop.
Grant access to gated content Sitecore webforms for marketers
This file contains 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 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