FBA logon issue in SharePoint

I have a sharepoint FBA site with a custom login code (see below). When the user login system and I pass the Cookie value to FormsAuthentication.RedirectFromLoginPage(userName, false); . It works fine so far.

The problem is that if a user logs out and logs out and logs in with a different user ID and comes to my SharePoint site, the registration process is skipped and the user is logged in with the old ID (not with the new login ID).

Is there any way to go through the login process if the user URL for the sharepoint site is redirected to the site site.

Please, guru help me.

  try { if (Request.Cookies[authCookie].Value.Length > 0 || Request.Cookies[authCookie].Value != null || Request.Cookies[authCookie].Value != "") { userName = Request.Cookies[authCookie].Value; } } catch (Exception ex) { Response.Redirect("https://qa.company.com/appssecured/login/servlet/LoginServlet?TARGET_URL=" + Request.Url); } if (true) { userName = Request.Cookies[authCookie].Value; FormsAuthentication.RedirectFromLoginPage(userName, false); } 

Web.config

 <authentication mode="Forms"> <forms loginUrl="LoginAuth.aspx" timeout="2880" enableCrossAppRedirects="false" /> <!-- <forms loginUrl="/_layouts/login.aspx" />--> </authentication> 
+4
source share
1 answer

Why not use

 FormsAuthentication.SignOut(); FormsAuthentication.RedirectToLoginPage(); 

This should clear the cookie correctly and redirect to the login page.

+1
source

Source: https://habr.com/ru/post/1400065/


All Articles