View Full Version : Setting cookie

25 Aug 2010, 6:12 AM
How i can set cookie in this code

onSuccess:function(form, action) {
Ext.util.Cookies.set("userId", 1);
Login.win.hide();} // onSuccess FINISH
using this json-response


I want to set userId to user.id from response

25 Aug 2010, 7:31 AM
Depending on the rest of your code, you may or may not need to decode the JSON response from the server. Ext.decode() will do that for you.

You could probably just use:

Ext.util.Cookies.set("userId", action.result.user.id)