开发者

WP7 How to save cookies between tombstoning?

开发者 https://www.devze.com 2023-02-22 15:18 出处:网络
I need to persist a few cookies (they are not marked HttpOnly) between requests after signing in. I have it working in normal cases, but not after coming back from tombstoning. I\'ve tried saving them

I need to persist a few cookies (they are not marked HttpOnly) between requests after signing in. I have it working in normal cases, but not after coming back from tombstoning. I've tried saving them to IsolatedStorageSettings.ApplicationSettings as a Dictionary<string, Cookie> on the deactivated event, however, some properties of the cookies are different when I retrieve them on the activated event. Here are some of the changes in the cookie values. I got these from evaluating the cookie in the immediate window to get all it's values.

_Port: changed from "" to "$Port"

m_domain_implicit: changed from true to false

m_port_implicit: changed from true to false

The service calls work before tombstoning but not after and the only difference between calls are the cooki开发者_开发问答es. Anyone know why cookie values are changing when returning from tombstoning and getting the cookies from IsolatedStorageSettings.ApplicationSettings. Is there a better way to save cookies when tombstoning?


Anything you add to IsolatedStorageSettings is serialized with the DataContractSerializer. My guess is that this doesn't handle the serialization and deserialization correctly.

If this is the case you'll have to handle the serialization and deserialization yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消