javascript - How do I read a cookie created in jquery from code behind in vb.net? -


i have created cookie in javascript...

(document).ready(function () {     $.cookie("test", "hello michael");     alert($.cookie("test")); }); 

the alert displays cookie content expected. , trying read in vb.net code behind...

dim cookie httpcookie cookie = httpcontext.current.request.cookies.get("test")  if isnothing(cookie)   txtcookie.text = "cookie not found" else   txtcookie.text = cookie.value end if 

i 'cookie not found".

i missing something... please advise!

you need add path value cookie,

$.cookie("test", "hello michael", { path : "/" }); 

and, request.cookies("test") work. also, (document), $ missing.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -