[AWS] A Little Cookie Problem on Opera Browser

Graham Stark graham.stark at virtual-worlds.biz
Thu May 16 09:51:02 CEST 2013


Hi,
   yesterday I was showing someone one of my AWS programs using the the
Opera browser and discovered that cookies were not being set.This seems
to be because the the Max-Age field in the cookie string is being
formatted as a Decimal number rather than an integer. All other browsers
seem tolerant of this, and Opera used to be, since the program was
mainly tested in version (I think) 9 of Opera, but the new version 12.10
is not.

This is around line 159 in aws-cookie.adb:
            
Messages.Max_Age_Token & "=" & Utils.Image (Max_Age) & "; ");

Max_Age is of type Duration, and Utils.Image formats it with a trailing
".00". I think Opera is then not parsing the field, setting Max-Age to 0
and immediately deleting the cookie.

If you cast the Max_Age to Integer or Natural it should work (unless it
goes out-of-range: can it?)

The relevant RFC is, as you know, http://tools.ietf.org/html/rfc2109 
section 4.2.2 

As an example, this version of my server should fail with a message
about cookies when viewed in version 12 of Opera (though it works in all
other browsers I've checked):

http://econflemosi1.econ.kuleuven.ac.be/mefisto/

whereas this version, with the cast on  line 159, should work in Opera:

http://projectsvr.virtual-worlds-research.com/mefisto/

hope this helps,

Graham


-- 
Graham Stark, Virtual Worlds Research
http://www.virtual-worlds-research.com
136 Hainault Avenue, Milton Keynes, MK14 5PG, UK
t: (+044) 01908 618239 skype: graham_k_stark m:(+044) 075283 45116



More information about the AWS mailing list