Setting a new cookie with the API

Beau Cowan asked on May 6, 2014 15:45

I'm setting up a Terms & Conditions blurb that is in an asp container and will switch out to the proper content when a cookie is set on the clients machine.

I've been trying to use the CookieHelper class to create the new cookie, but I can't seem to get it to stick on the client machine. Is there something that I'm missing?

Correct Answer

Filip Ligač answered on May 26, 2014 13:41

Hi Beau,

Could you paste the code you used for setting a cookie?

Using CookieHelper should be straightforward. There are basically only 2 essential methods:

CookieHelper.SetValue(String name, String value, DateTime expires); - sets the cookie
var existingCookie = CookieHelper.GetExistingCookie(name); - gets the cookie
2 votesVote for this answer Unmark Correct answer

Recent Answers


piyush kothari answered on March 25, 2015 12:45

How can we set domain of cookie? For ex: site domains are abc.xyz.com and xyz.com how do i set cookie on xyz.com from abc.xyz.com using Kentico's API?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.