integrate session with db