Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (24 sloc) 679 Bytes
<?xml version="1.0" ?>
<page xmlns:x="http://www.yandex.ru/xscript" xmlns:xi="http://www.w3.org/2001/XInclude">
<x:lua>
<![CDATA[
c = xscript.cookie.new('foo', 'bar')
print(c:name())
c:path("/some/path");
c:domain(".example.com");
c:secure(true);
c:expires(123456789);
print("path:", c:path())
print("domain:", c:domain())
print("secure:", c:secure())
print("expires:", c:expires())
xscript.response:setCookie(c)
c2 = xscript.cookie.new('baz', 'foo')
print("perm1", c2:permanent())
c2:permanent(true)
print("perm2", c2:permanent())
print("expires2:", c2:expires())
xscript.response:setCookie(c2)
]]>
</x:lua>
</page>