implemented storing new session in the database. Excet the targets