Reputation: 823
Hy,
I'm developing a website in ASP.NET MVC 5 on my local machine. I'm trying to read a cookie, which I've set by the backend. jQuery and the cookie plugin is included in my code. My code:
var test = $.cookie['test'];
The cookie "test" exist with following properties:
I've read many posts about issues with cookies, but nothing worked for me.
Upvotes: 0
Views: 1186
Reputation: 388316
$.cookie
is a function so you need to invoke it(by using () at the end), you are trying to read a property called test
var test = $.cookie('test');
Upvotes: 5