Remove `state` from config as this should be set on the fly.
Changed method name and minor tweaks added
Utilize `Session` based on application settings. Replaced direct access to native PHP session.