added sessions and redirect if logged in and friendly redirect