Skip to main content
Version: 1.21.3

SimpleSession

This scoped class provides a method that gets the information about the current session.

The constructors used for creating an instance of the scoped SimpleSession object are not available. Use the ss.getSession() method instead.

getClientIP()


Use this method to return the field value containing the IP-address of the client.

Return:

TypeDescription
StringThis method returns the IP address value by default. It returns null if there are no IP values.

Example:

getClientIP()
const session = ss.getSession();
const ipAddress = session.getClientIP();
ss.info(ipAddress); // Info: 127.0.0.1