Setting a P3P cookie in response to an autologin action.

Add-in Express™ Support Service
That's what is more important than anything else

Setting a P3P cookie in response to an autologin action.
Jyry Suvilehto

Posts: 5
Joined: 2012-10-04
I'm having problems in storing an authentication cookie properly.

I have a simple demo plugin that does the following at browser start up:

1) makes a http GET with basic auth header
2) finds the corresponding Set-Cookie header in response
3) tries to set the cookie using InternetSetCookieEx

This works fine as long as I don't attempt to set the cookie with correct p3p headers. If i navigate to the site directly, IE sends the cookie with every time. If the page is inside an iframe this doesn't work as IE won't do this without the p3p header present. This is a problem as we would like the authentication to work both top-level and in iframes.

Trying to set the p3p header fails with an AccessViolationException. This could be caused by either my handling the last parameter incorrectly or by some kind of memory protection mechanism that I don't entirely understand.

I can send you a minimal code example that illustrates this problem. I would rather send it via email and not host a zip somewhere. Could you have a look at it and tell me if there is a better method of achieving the above or if there's some kind of memory protection mechanism in place that I'm unaware of?
Posted 04 Jun, 2013 06:42:27 Top
Sergey Grischenko

Add-in Express team

Posts: 7235
Joined: 2004-07-05
Hi Jyry,

Ok, please send the example on the support e-mail. I will try to help.
Posted 05 Jun, 2013 08:03:10 Top