<?xml version="1.0" encoding="utf-8"?>
<KScriptSetting>
  <Name>session</Name>
  <Description>a temporary storage for small interactive information. Session does not persist</Description>
  <Example><![CDATA[
    <script engine="kscript">

    var obj = {clientid: 123, name: "firstname"};
    k.session.set("key", obj);

    var back = k.session.get("key");
    k.response.write(back.name); 
    
    </script>
	]]></Example>
  <Props>
    <Property>
      <Name>keys</Name>
      <Description>keys</Description>
      <Type>array</Type>
    </Property>
    <Property>
      <Name>values</Name>
      <Description>values</Description>
      <Type>array</Type>
    </Property>
  </Props>
  <Methods>
    <Method>
      <Name>set</Name>
      <Description>Set a Key Value in the session store.</Description>
      <Example> 
        k.session.set("key", "value"); 
      </Example>
      <Params>
        <Param>
          <Name>key</Name>
          <Description>key</Description>
          <Type>string</Type>
        </Param>
        <Param>
          <Name>value</Name>
          <Description>object value</Description>
          <Type>object</Type>
        </Param>
      </Params>
    </Method>
    <Method>
      <Name>get</Name>
      <Description>get stored session value</Description>
      <Example> 
        var value = k.session.get("key"); 
      </Example>
      <Params>
        <Param>
          <Name>key</Name>
          <Description>key</Description>
          <Type>string</Type>
        </Param>
      </Params>
      <ReturnType>object</ReturnType>
    </Method>
    <Method>
      <Name>remove</Name>
      <Description>Remove item from session by session key.</Description>
      <Example>
      k.session.remove("key"); 
      </Example>
      <Params>
        <Param>
          <Name>key</Name>
          <Description>key</Description>
          <Type>string</Type>
        </Param>
      </Params> 
    </Method>
    <Method>
      <Name>clear</Name>
      <Description>remove all items from session</Description>
      <Example>
      k.session.clear(); 
      </Example>
      <Params />
    </Method>
    <Method>
      <Name>contains</Name>
      <Description>check whether session has the key or not. </Description>
      <Example>
      if (k.session.contains("key"))
      {
         //has value
      }
      </Example>
      <Params>
        <Param>
          <Name>key</Name>
          <Description>key</Description>
          <Type>string</Type>
        </Param>
      </Params>
      <ReturnType>boolean</ReturnType>
    </Method>
  </Methods>
</KScriptSetting>