_satellite.setCookie(cookiename, value, days) | Adobe Higher Education
Skip to main content
sanketd28
Level 2
July 2, 2018
Respondido

_satellite.setCookie(cookiename, value, days)

  • July 2, 2018
  • 3 respostas
  • 8027 Visualizações

Hi,

I would to set cookie using _satellite.setCookie(cookiename, value, days) but if you see the parameters, we have an option to expire it in days. On the other hand, I want to expire the cookie when user session ends. Is there any way to achieve this?

Thanks in Advance !

Este tópico foi fechado para respostas.
Melhor resposta por Alexis_Cazes_

why don't you use a data element that expire at the session ?

3 Respostas

Alexis_Cazes_
Level 10
July 4, 2018

why don't you use a data element that expire at the session ?

marion33678522
Level 5
July 5, 2018

Hello sanketd28​ ,_satellite.setCookie("helloCookie", "test", 0);

From old memory, I think if you give a 0 value, or no value at all, the cookie will expire after the session.

Such as :

_satellite.setCookie("helloCookie", "test", 0);

or


_satellite.setCookie("helloCookie2", "test2");

I did this a long time ago , you should still test it ! Dev tools (F12) in chrome or firefox, give you the expiration of all your cookies !

Cheers !

Mario

Jason_Egan
Adobe Champion
Adobe Champion
December 11, 2018

I know that this is a bit of an old post, but in case anyone searches for this and finds this post, it's worth noting that the _satellite.setCooke/readCooke/deleteCookie functions are not supported in Adobe Launch. So, you will run into problems when migrating there if you use these functions.