Javascript API and set_device_state

A basic question: is there a way with the JavaScript API to simply set a device variable as we do with variable_set in luup, I mean an immediate and persistent update of the state variable ?
Here is the description of the parameters:

dynamic (number): if 1, the variable's value is saved to lu_status (the value is lost after Luup is restarted), else, the variable's value is saved to a copy of user_data; the real user_data is updated when LuaUPnP is restarted.

My current feeling is that it is not possible. Am I right ?

No … You can create a Request Handler in LUA … and have the JavaScript make an Ajax call to the LUA to set the variable(s) or what every else you want the request handler to do.