Moved session storage logic to _start_session function.
Added support for memcached