I’m using this code to generate a cookie named LIDR to save the parameter ?lider=XXX But Chrome Devtool says that this cookie expire in session :-/
<script type="text/javascript">
$.urlParam = function(name){
var results = new RegExp('[?&]' + name + '=([^]*)').exec(window.location.href);
if (results==null){
return null;
}
else{
return results[1] || 0;
}
}
var source = $.urlParam('lidr').split('&')[0];
// Set the cookies
if(Cookies.get('lidr') == null || Cookies.get('lidr') == "") {
Cookies.set('lidr', source);
}
</script>
I don’t find the way to add a 1 month expiration date. May someone can help me.
TIA
Tried several option without success :-/