M
M
mikemoix2014-05-03 17:22:53
Windows phone
mikemoix, 2014-05-03 17:22:53

Windows phone Cookie saving

The problem is this: I log in to the site, the server sends me cookies as expected. I intercept it and pack it in a CookieContainer and try to save it in IsolatedStorageSettings.

CookieContainer _Cookie = new CookieContainer();
var Settings = IsolatedStorageSettings.ApplicationSettings;
_Cookie.Add(new Uri("http://www.portal.fa.ru/Job/SearchResultDiv"), response.Cookies);
                Settings.Clear();
 
                Settings["UserID"] = userID;
                Settings["Cookie"] = _Cookie;
 
                Settings.Save();

Everything works well. But after restarting the application, I am accessing the cookie (which should have persisted). I assign to the object
var a = Settings["Cookie"];
And now what do I have - there are no cookies (somewhere gone, but I saved it). There is an object, but it is empty for cookies (their number = 0).
And what can I do in such a situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question