javascript - Different cookie name -


cookie info

can red , blue outlined names different. have written code below. or if there better way.

set_custom_cookies: function ( cookiename,cookiedata,days ) {     if ( days ) {         var date = new date();         date.settime( date.gettime()+( days*24*60*60*1000 ) );         //cookie expiration date         var expires = "; expires="+date.togmtstring();     } else var expires = "";      //add cookie info      document.cookie = cookiename + "=" +cookiedata + expires + "; path=/"; } 

when pass data function set_custom_cookies() send argument cookiename. name of cookie want change. call else.

set_custom_cookies("mycustomname", cookiedata, days);


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -