getSession
(since )
Retrieves a value from the session on the APE server.
Description
string
getSession
(
mixed key, [function callback] )
Retrieves a value from the session on the APE server.
Parameters
key
A string if you just need to get on key.
An array of key if you want to get multiple key in one request.
callback
Callback function to execute when the sessions is received. One arguments is passed to the callback function with the response of the server.
Examples
//ape var is a reference to APE instance
ape.setSession({'myKey1':'myValue','myKey2':'myValue2'});
ape.getSession('myKey', function(resp) {
console.log(resp.datas.sessions.myKey);
});
//ape var is a reference to APE instance
ape.setSession({'myKey':'["A Json array", "Value 2"]'});
ape.getSession('myKey', function(resp) {
//decode the received data, and use eval to dedode the data
console.log(eval(decodeURIComponent(resp.datas.sessions.myKey)));
});
User notes
Adrian said:
How to get/set session values on the server side? is this possible? But to clear the session on the server side?I think there is some missing documentation about session handling on the server side!
Thanks!
11/05/10 11:32
Post a note
CollaborAPE to our wiki !
Find the information you need on the APE Official Wiki : Install, Server, JSF, Help...

it must be resp.data.sessions.myKey
data not datas