Skip to content

Instantly share code, notes, and snippets.

@islaytitans

islaytitans/GrantGatedAccess.cs Secret

Last active Jun 30, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.