now with sessions and db support