How to set a session cookie using "utag.loader.SC"?

Gold Contributor
Gold Contributor

Hi

 

How does one set a sessoin cookie using, "utag.loader.SC"?

 

The main cookie article covers days and years only.

 

Thanks

Samrat D'souza

2 REPLIES 2

How to set a session cookie using "utag.loader.SC"?

Gold Contributor
Gold Contributor

For people looking for this Info:

 

For example using the utag_main time out value:

 

utag.loader.SC("utag_mycookie", {"mycookie1": "value;exp-session", "_st" : utag.data["cp.utag_main__st"]});

Or if you would like to set the session timeout period from when you set the cookie you can use:

 

utag.loader.SC("utag_mycookie", {"mycookie1": "value;exp-session", "_st" : ((new Date()).getTime() + parseInt(utag.cfg.session_timeout))})

utag.cfg.session_timeout, is by default 30 mins, which can be changed via the Publish Config Setting in TiQ.

 

 

Thanks to @adrian_browning.

How to set a session cookie using "utag.loader.SC"?

Employee Emeritus

@samrat_dsouza wrote:

For people looking for this Info:

 

utag.loader.SC("utag_main", {"total_price_cookie": tot_price_in_cart+";exp-session"});


Thank you @samrat_dsouza for sharing!

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.
Public