io.undertow.util

## Class Sessions

- java.lang.Object
- - io.undertow.util.Sessions

    public class Sessions
    extends Object

Utility class for working with sessions.

Author:
  Stuart Douglas

### Method Summary

All Methods Static Methods Concrete Methods
`static Session` `getOrCreateSession(HttpServerExchange exchange)` Gets the active session, creating a new one if one does not exist
`static Session` `getSession(HttpServerExchange exchange)` Gets the active session, returning null if one is not present.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getSession

    public static Session getSession(HttpServerExchange exchange)

Gets the active session, returning null if one is not present.

Parameters:
  `exchange` - The exchange
Returns:
  The session

#### getOrCreateSession

    public static Session getOrCreateSession(HttpServerExchange exchange)

Gets the active session, creating a new one if one does not exist

Parameters:
  `exchange` - The exchange
Returns:
  The session