changes, optimalizations in 'session' plugin