jquery - How to set php cookie via ajax -
i've done little browsing on site regarding topic. , found out possible set php cookies via ajax. don't know why can't set cookies on ajax called php script. set default value, make sure cookie getting something:
setcookie("tradename", 'mono', time()+3600); setcookie("bus_id", 'loque', time()+3600);
the ajax called php script has mysql queries on it. , they're inserting records database. setting of cookies happens before queries.
but don't know why i'm not getting when use print_r page:
print_r($_cookie);
i'm using jquery's ajax() function. do detect what's wrong, please help. thanks.
you don't need ajax set cookies js. @ "jquery cookie" plugin here, maybe it. example usage @ top of jquery.cookie.js.
Comments
Post a Comment