diff --git a/GlideSystem/Session/readme.md b/GlideSystem/Session/readme.md new file mode 100644 index 0000000000..6debab911c --- /dev/null +++ b/GlideSystem/Session/readme.md @@ -0,0 +1,8 @@ +GlideSystem (referred as "gs") is used to get the current user session which we are using to set the custom key and value which are used in client side scripts. + +Example client script used to retrieve it, + +function onLoad(){ + var value = g_user.getClientData("custom_key"); + console.log("Client data "+value); +} diff --git a/GlideSystem/Session/session.js b/GlideSystem/Session/session.js new file mode 100644 index 0000000000..3dfd340ed0 --- /dev/null +++ b/GlideSystem/Session/session.js @@ -0,0 +1,8 @@ +//Get user session object. +var session = gs.getSession(); + +//Set value for custom key +session.putClientData("custom_key","custom_value"); + +//Print the value for the key supplied +gs.print(session.getClientData("custom_key"));