edit session to database