Javascript setcookie : Network : PHP functions in JavaScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » PHP functions in JavaScript » Network »

 

Javascript setcookie


Send a cookie
Example 1

Running
1.setcookie('author_name', 'Kevin van Zonneveld');

Could return
1.true
function setcookie(name, value, expires, path, domain, secure) {
    // Send a cookie  
    // 
    // version: 901.810
    // discuss at: http://phpjs.org/functions/setcookie
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   bugfixed by: Andreas
    // +   bugfixed by: Onno Marsman
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // -    depends on: setrawcookie
    // *     example 1: setcookie('author_name', 'Kevin van Zonneveld');
    // *     returns 1: true
    return setrawcookie(name, encodeURIComponent(value), expires, path, domain, secure)
}


HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo PHP functions in JavaScript
» Network