Put session maintenance into database