views:

642

answers:

1

In our website, we add a log whenever a user logs in. Now we add the log just before it goes to the home page. But, suppose when the user is not logged in and try to hit any url other than the home page or default page. At that case the ReturnUrl is that page in login page. So, after the login it goes to the requested page instead of home. So, it doesn't go through the part where we are logging about the log in of the user.

So I am trying two things either we can any way disable the ReturnUrl or we can set default ReturnUrl so irrespective of the ReturnUrl it goes always to the home page.

Can anybody help me with this.

We are using Form authentication

 <authentication mode="Forms">
  <forms loginUrl="Login.aspx" defaultUrl="Default.aspx" protection="All" path="/" slidingExpiration="true" cookieless="UseCookies" enableCrossAppRedirects="true" />
</authentication>
+1  A: 

If you are adding a log of the users that log in then it would be more appropriate to put the code that adds the log with the code that authenticates the user. So create the log, in the login action/page rather than on the home action/page.

David G
Actually we can not change the login action. So, was just thinking is there any way around.
Bipul
If you have no control over the login code then I assume you can't change where that code is redirecting to. We really need more information (code example) to help you further.
David G