comparison src/luan/modules/http/Http.luan @ 1156:3839ecc130ea

cookie fixes
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 04 Feb 2018 23:18:51 -0700
parents bbad9a21277c
children 267fdf5e9fbd
comparison
equal deleted inserted replaced
1155:4100304340bc 1156:3839ecc130ea
98 98
99 function this.set_cookie(name,value,attributes) 99 function this.set_cookie(name,value,attributes)
100 HttpServicer.setCookie(Http.request.java,this.java,name,value,attributes) 100 HttpServicer.setCookie(Http.request.java,this.java,name,value,attributes)
101 end 101 end
102 102
103 function this.set_persistent_cookie(name,value,attributes) { 103 function this.set_persistent_cookie(name,value,attributes)
104 attributes = attributes or {} 104 attributes = attributes or {}
105 attributes["Max-Age"] = "10000000" 105 attributes["Max-Age"] = "10000000"
106 this.set_cookie(name,value,attributes) 106 this.set_cookie(name,value,attributes)
107 } 107 end
108 108
109 function this.remove_cookie(name,domain) 109 function this.remove_cookie(name,attributes)
110 attributes = attributes or {} 110 attributes = attributes or {}
111 attributes["Max-Age"] = "0" 111 attributes["Max-Age"] = "0"
112 this.set_cookie(name,value,attributes) 112 this.set_cookie(name,"delete",attributes)
113 end 113 end
114 114
115 function this.set() 115 function this.set()
116 HttpServicer.setResponse(this,this.java) 116 HttpServicer.setResponse(this,this.java)
117 Http.sent_headers(this.headers) 117 Http.sent_headers(this.headers)