Developer forum

Forum » Development » GetCookie returns null

GetCookie returns null

Unnsteinn Garðarsson
Unnsteinn Garðarsson
Reply

Is there something that I am missing here or what?

I have the following code.

List<string> cookies = CookieManager.GetDynamicwebCookiesList();
var cookie = CookieManager.GetCookie("Email");


The list of cookies look like this

But GetCookie just returns null.


DW version is 9.12.7


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
The GetDynamicwebCookiesList method returns a list of known cookies and automatically detected cookies across all browser/visitor sessions.
 
The GetCookie and SetCookie methods are related to the current session.
So GetCookie returns null because the cookie has not been set in the current session.
 
Can you explain what you are trying to accomplish?

 

You must be logged in to post in the forum