开发者

Disable the Return URL in Form Authentication

开发者 https://www.devze.com 2022-12-21 20:39 出处:网络
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 pa

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" enable开发者_如何转开发CrossAppRedirects="true" />
</authentication>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消