changing session to DB