If this is for any type of session management or used as a key to access confidential information (password, financial, medical, etc.), you do not want to store it in a cookie - of course, it doesnβt matter.
It is good practice to use a session cookie that is encrypted so that it is difficult to guess, checked based on a link to the internal server, it is often updated (whenever there is a change in security status, for example, switching from http to https pages) and is canceled when you exit or exit systems to prevent reuse.
source share