Welcome Guest Search | Active Topics | Sign In | Register

Cookie Settings getting Ignored Options
System Monitor
Posted: Monday, August 27, 2018 10:46:39 AM
Rank: Newbie
Groups: Member

Joined: 4/27/2018
Posts: 6
Why cookie settings are ignored?
If the library allows us to set cookies and configure them, we believe those settings should be applied.


Scenario for EO developers:
1) We have html page with image. Image src is pointed to SERVER_A
2) In our application ( which is started on SERVER_B) we are using EO htmlToPdf. Before convert, we set cookies with restriction (domain = SERVER_B). We expect that cookies are not sent to SERVER_A. But they are.

Code:
Dim cookie As Net.Cookie = New Net.Cookie(cookieName, cookieValue) With {
.Path = "/",
.Domain ="SERVER_B",
.Expires = DateTime.Now.AddDays(1)
}
htmlToPdfOptions.Cookies.Add(cookie)
HtmlToPdf.ConvertUrl(html, pdf, htmlToPdfOptions)


Thanks.
eo_support
Posted: Monday, August 27, 2018 2:55:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,258
Hi,

It doesn't work this way. The cookie you provided are the "overriding" cookies, which means they would override the cookies from the browser engine's "cookie jar". Cookie properties such as domain name and expiration date are used when the browser engine interacts with cookie jar (for example, a simple search in the cookie jar for cookies matching the current request would not return any expired cookies). They have no bearings on cookies explicitly provided by you. Those cookies are taken as is. So if you want to filter them out, you must filter them out in your code.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.