Thursday 15 January 2015

cookies - Python SimpleCookie Access Using CherryPy -



cookies - Python SimpleCookie Access Using CherryPy -

i'm having issues retrieving cookies sent client on server using python module cherrypy.

in web browser can see cookies in chrome's web console going resources -> cookies -> localhost. , have 3 cookies next values.

and on server side have next info eclipse debugger:

my question why don't foo , release_id show in keys? there i'm doing wrong?

note:

cookies = cherrypy.request.cookie

javascript code setting cookies:

$(function() { // functions w3c schools: http://www.w3schools.com/js/js_cookies.asp function setcookie(cname, cvalue, exdays) { var d = new date(); d.settime(d.gettime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toutcstring() + ";"; var path = "path=/;" // accessible all. document.cookie = cname + "=" + cvalue + "; " + expires + path; } function getcookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i<ca.length; i++) { var c = ca[i]; while (c.charat(0)==' ') c = c.substring(1); if (c.indexof(name) != -1) homecoming c.substring(name.length, c.length); } homecoming ""; } setcookie("foo", "bar", 1 ); setcookie("release_id", "2", 1 ); });

are sure cookies.keys not cherrypy.response.cookie?

cherrypy.response.cookie != cherrypy.request.cookie

from debugger print-screen perspective, seems ok havecherrypy.response.cookie thesession_id key @ point.

python cookies cherrypy

No comments:

Post a Comment