Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>By another location do you mean trying to login on 2 different devices?</p> <p>So if I was signed in on my computer and then tried to login on my phone, the phone should not be able to login and should log the user out?</p> <p>If this is correct then:</p> <p>On user session start</p> <ul> <li>if a user is already logged in, sign them out</li> <li>store the login information (IPAddress) in a DB or Application state</li> </ul> <pre><code>if (System.Web.HttpContext.Current.Application[System.Web.HttpContext.Current.User.Identity.Name] != null) { System.Web.HttpContext.Current.Response.Redirect("http://&lt;server&gt;/_layouts/SignOut.aspx"); } else { System.Web.HttpContext.Current.Application[System.Web.HttpContext.Current.User.Identity.Name] = System.Web.HttpContext.Current.Request.UserHostAddress; } </code></pre> <p>On user session end </p> <ul> <li>remove the login information (IPAddress) from DB or Application state</li> </ul> <pre><code>if (System.Web.HttpContext.Current.Application[System.Web.HttpContext.Current.User.Identity.Name] != null &amp;&amp; System.Web.HttpContext.Current.Request.UserHostAddress != System.Web.HttpContext.Current.Application[System.Web.HttpContext.Current.User.Identity.Name]) { System.Web.HttpContext.Current.Application.Remove(System.Web.HttpContext.Current.User.Identity.Name); } </code></pre> <p>You could potentially see a problem if you have a long session timeout and try and login to another device before original session is destroyed.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload