javascript - Access Cookie created in JS on PHP -


i created cookie via javascript, able access in php too?

js create cookie

function pb_create_cookie(name, value, days2expire, path) {     var date = new date();     date.settime(date.gettime() + (days2expire * 24 * 60 * 60 * 1000));     var expires = date.toutcstring();     document.cookie = name + '=' + value + ';' +                    'expires=' + expires + ';' +                    'path=' + path + ';'; }  pb_create_cookie('tour_in_progress', '1', 30, "/"); pb_create_cookie('tour_id', 105, 30, "/"); pb_create_cookie('tour_step', 0, 30, "/"); 

cookie usage in php

$tour_id       = $_cookie['tour_id']; $tour_progress = $_cookie['tour_in_progress']; $tour_step     = $_cookie['tour_step']; 

referrence: http://www.pontikis.net/blog/create-cookies-php-javascript


Comments