@Override
    public Optional<String> getSessionId(final WebContext context, final boolean createSession) {
        if (createSession) {
            generateIdIfNecessary();
        }
        return Optional.ofNullable(id);
    }
Mock a session store in memory.

@author Jerome Leleu
@since 1.9.0
pac4j-core/src/test/java/org/pac4j/core/context/session/MockSessionStore.java