setSession
(since )
Save a session variable on the APE server.
Description
string
setSession
(
string key, string value )
Adds a key-value pair to the session on the APE server or replaces a previous value associated with the specified key.
Parameters
key
The key to save on the APE server
value
The value to associate with the specified key.
Examples
//ape var is a reference to APE instance
ape.setSession({'myKey1':'myValue','myKey2':'myValue2'});
ape.getSession('myKey', function() {
console.log(resp.datas.sessions.myKey1);
});
//ape var is a reference to APE instance
ape.setSession({'myKey':'["A Json array", "Value 2"]'});
ape.getSession('myKey', function(response) {
//decode the received data, and use eval to dedode the data
console.log(eval(decodeURIComponent(response.datas.sessions.myKey)));
});
User notes
# No comment
Post a note
CollaborAPE to our wiki !
Find the information you need on the APE Official Wiki : Install, Server, JSF, Help...
