move settigns to database. more strictly reset session values.