Cookie processing

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

When the server returns more than  one line of cookie string 1c merges 2 strings so it is difficult to read cookie values. Shouldn't it be presented with 2 lines? O with the map?

Example

Code
HTTP/1.1 200 OK
Date: Wed, 20 Jul 2016 00:18:04 GMT
Server: Apache
Set-Cookie: JSESSIONID=Ph6AFBXDkVASoA2bNO+HY7Ky.sriinternet05i1; Path=/facturacion-internet; Secure
X-Powered-By: JSP/2.2
Cache-Control: max-age=600
Expires: Wed, 20 Jul 2016 00:28:04 GMT
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/html;charset=ISO-8859-1
Set-Cookie: BIGipServerDeclaraciones_sri.gob.ec=186515722.47873.0000; path=/; Httponly; Secure

 
#2
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

For those who would probably face the same problem start your code with:

Code
   CookieString = StrReplace (CookieString, ", ", "; ");


This should change comma to a semicolon standard separator, aunque if there is comma inside cookie value it will provoke error.

 
#3
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Alexey!

Do you mean that when you are making a HTTP request to some site, this site receives cookie with values separated by comma, not semicolon?

 
#4
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Hello Timofey,

No. If I make a HTTP request to some site it could return Set-cookie header in response. So to make a following request I need to pass received cookies.
One site returns 2 lines of Set-cookie headers (I could see it with debugging proxy, in my post above) but 1C:Enterprise merges these string into one with the comma between two parts, not semicolon.
I do not know if modern version of platform still have this behavior, but as of 8.3.6. it does.I would suggest to replace comma with semicolon inside the platform.

p.s. It seems like one Set-cookie is from Java and another one from load balancer, so it could be common.

 
#5
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Alexey.

Could you please create a sample configuration where I could reproduce this issue and a list of actions to reproduce it. And if on 8.3.8 it is still the same, I will submit the error description to the developer team.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.