Take the community feedback survey now.
AI OnAI Off
Take the community feedback survey now.
In case its needed:
Criterion:
[VisitorGroupCriterion(
Category = "Technical",
Description = "Determines if the current request contains the specified cookie (lookup by name)",
DisplayName = "Cookie exists123")]
public class CookieExistsCriterion : CriterionBase<CookieExistsViewModel>
{
public override bool IsMatch(IPrincipal principal, HttpContextBase httpContext)
{
if (httpContext.Request == null)
{
return false;
}
return httpContext.Request.Cookies[this.Model.CookieName] != null;
}
}
model:
public class CookieExistsViewModel : CriterionModelBase
{
[Required]
public string CookieName { get; set; }
public override ICriterionModel Copy()
{
return ShallowCopy();
}
}
Hi, I have setup a custom criterion that checks for cookie existance as per this post http://tedgustaf.com/blog/2011/10/create-new-visitor-group-criterion-in-episerver/
I have all this setup fine, the trouble im running into is that the criterion is appearing twice:
I have searched my code in case there was another instance of the class by mistake, which there isnt, also renamed the one I had to double check this. I then reverted my db to an ealier backup in case it was a previous version, on load I would still have two instances. All I can think of is something is loading this object twice in the initialisation?