Hi Mark,
Thanks for the reply. Here I'm logging the user, say in portal 3, and redirecting the user to the same portal, not another portal.
I have a registration page in another project where the user register and then the login page is called which is in my DNN site to log in the user via code automatically so when the user is redirected to the portal site he is already logged in.