Fork me on GitHub Fork me on GitHub

session


<%
    var obj = {
    	name : "wso2",
    	cat : "software",
    	address : {
    		number : "59",
    		address : "Flower Rd.",
    		city : "Colombo 7"
    	}
    };
    session.put("wso2", obj);
 
    var o = session.get("wso2");
    print("<html><body>");
    print(o);
    print("</body></html>");
%>

Overview

Object that provides the properties and functions of HTTP Session.


Members

Member Type Description
maxInactiveNumber
session.maxInactive
Returns the max inactive interval of the session

Operations

Operation Returns Description
getCreationTime()String
session.getCreationTime()
Returns the session created time
getLastAccessedTime()String
session.getLastAccessedTime()
Returns the last accessed time of the session
put(key, value)None
session.put('name', 'wso2')
Functions to put values to the session
get(key)String
session.get('name')
Returns values in the session
getId()String
session.getId()
Returns Id of the session
remove(key)None
session.remove(key)
Removes an attribute from the session.
invalidate()None
session.invalidate()
invalidates the session
isNew()Boolean
session.isNew()
Returns the true|false