Writing a fixed string to cookies can be done easily using methods like
Cookies.set(\'cookie_2\', \'value\', { expires: 7 })
(see tutorial here).
However, saving the variable user
to cookie_2
may require a different approach. For example:
user = "Klay"
runjs('Cookies.set(\'cookie_2\', user, { expires: 7 });')
Is there a way to achieve this in a single line of code? Any suggestions would be appreciated. Thanks.