Hi,
I am creating some cookies in velocity report using javascript function —
function setCookie(c_name,value,exdays){
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? “” : “; expires=”+exdate.toUTCString());
document.cookie=c_name + “=” + c_value;
}
function loginSubmit(){
setCookie(“userId”,document.getElementById(“userID”).value,365);
setCookie(“pwd”,document.getElementById(“pwd”).value,365);
setCookie(“serverName”,document.getElementById(“serverName”).value,365);
}
and I want to call these cookies in servoy.
I am using Servory 5.2.13 and I can not update it with latest version of servoy.
How can do it?
Please help me. ![Sad :(]()
What do you mean you set cookies in VelocityReports? There’s no support for cookies in VelocityReports, unless you are talking about the Velocity web client? In which case you get these cookies from the vr_getContext(request) function, in the request object, as request.cookies. But I’m not sure what you are trying to do there, what is document?
Yes, I am using request.cookies to find all cookies and request.cookies.pwd return details of cookies through “pwd” key but request.cookies.pwd.value return undefined.
How can find value of key “pwd”?
I am using Servory 5.2.13 and I can not update it with latest version of servoy.
and
In JsLib, Json is not exist in Servoy 5.2.13, it exist in servoy 6.0.
Ah! Good one. The cookie, which is a subtype of the Velocity plugin, and an object on it’s own, was wrapped in a context that didn’t understand it during its instanciation: the result was that the toString() method was present (what you see when you output request.cookies.pwd), but the inner js_getXXX methods were not recognized… I’ll update the plugin in a bit. This will fix your issue.
Fixed in v2.0.11, please update.