Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:29:55+00:00 2026-05-23T21:29:55+00:00

I basically want to setup in my LogOn Action a conditional statement that looks

  • 0

I basically want to setup in my LogOn Action a conditional statement that looks at the username, and determines that username is already logged in.

At which point the user should be informed.

That account is logged in, if you think you’ve been hijacked…yada yada yada.

I thought I could add something after this conditional, is there something like my made up method Membership.CheckIfUserIsOnline(string username) out there already?

   if (ModelState.IsValid)
    {
        if (Membership.ValidateUser(model.UserName, model.Password))
        {
            //See the line below, I made this method up.
            if (Membership.CheckIfUserIsOnline(model.UserName){
                ModelState.AddModelError("", "Someone else is logged into this account.");
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:29:56+00:00Added an answer on May 23, 2026 at 9:29 pm

    If you’re using Session State, I would store (ideally in an application-wide cache or alternatively in your application database) a record keyed on the User ID, storing the Session ID.

    Then, check the logged-in User ID against the current Session ID when you’re looking to detect multiple logons. If the Session ID stored in the database doesn’t match the Session ID of the current Session, that may indicate multiple logons.

    You have to deal with expiring the values from the data store (which is why an application-wide cache may be better than the application database) and with normal termination of a session (on logoff), but if you’re only using it to alert the user, it’s probably good enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to setup my WinForm to look like the Delphi7 IDE. Basically that
basically I want to encapsulate a simple component from code that I already have.
Basically I want to setup a replication server for mysql datbase. I am completely
I have an iframe setup within a page and basically want to know whether
My setup is as follows: Table 'data': 'title','body',...,'user_id',... Table 'users': 'user_id','some_val'... Basically I want
I want to setup a x86 Linux Box such that: It uses minimal system
I want to write a test that perform Setup in several ways but expect
Basically I want to setup a tagging system like stack overflow has for entries
Basically, Im trying to setup a page so that when a link is clicked
I basically want to use link_to to link to the index method of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.