We help IT Professionals succeed at work.

How to add information to cookies

I am using Coldfusion. I have used a tool to generate a report about cookies and with some of the cookies it had information like purpose and service. How do I add extra information to my cookies?

For example:
Name:      __tlbcpv
Purpose:      Used to record the cookie consent preferences of visitors
Provider:      .termly.io
Service:      Termly View Service Privacy Policy  

Country:      United States
Type:      http_cookie
Expires in:      20 years
Comment
Watch Question

erikTsomikSystem Architect, CF programmer

Commented:
What exactly Are you trying to add. Please provide an example

Author

Commented:
I would like to add purpose and service like the example The service text would include a link to my Privacy Policy which is available on my website.
IT Expert
Top Expert 2009
Commented:

It sounds like you want to add custom information to the cookies.

So now a cookie has

name

value

expiry

path

secure


as defined by https://tools.ietf.org/html/rfc6265#section-5.2


If you yourself want to add 


Purpose:      Used to record the cookie consent preferences of visitors


there is no current mechanism to do so.


I would suggest you use a lookup table in your tool to store the purpose

Charlie ArehartTroubleshooting Consultant
Commented:
WestCoast_BC, it seema like the kind of cookie info you are referring to is about what would be shown in a "cookie policy", meant to report to users the purpose of all cookies on your site

The kind of text you quote is not coming from the cookies. Instead, it's text generated from any of various cookie policy generators. Those tools do their own lookup first of your cookies, then they generate the text based on their own  assessment of what such cookies (from generic site providers) are "about".

So your point would be how to tell such tools to regard your own site's custom cookies. There is no provision in cookies to do that.

Sound reasonable?