implemented sessions and session persistence to disk