Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I want to click a shortcut from the desktop that will open IE to a specific site address. However, I want it to look for any open IE browser windows and see if any of the tabs contain a portion of this site address, such as *.mycom

Multiple logins are killing me and the cloud app does not restrict user login attempts. The database gets all confused and so do my users.

I just can't even begin to decide what would be best for this. I am looking for some feedback and general logic - not code - I can figure that out. :)
Posted

1 solution

First, you can't query IE window for tabs that contain a link to your site. To achieve that, you might have to write a service.

As regards multiple logins... on my current project, I wanted something like what Facebook has, list all devices you were logged in on and sign you out from the ones you want. You could port that to your project.

I am using NoSQL so the logic is this...

Create a login session database.

When a user logs in to the server, generate a login key... I use the browser user agent, the username and the IP address like so 199.199.199.*** The last three digits are not used cause of dynamic IP addresses.

Store the Login Key in the DB.

For all logins, the DB looks something like so...

Users: {
    "Username1": {
       "logins":[
        {"agent":"Mozilla 3.2","OS":"Windows 2000","IP":"999.999.999.991","loginKey":"Key1"},
        {"agent":"IE8","OS":"Windows XP","IP":"999.999.999.191","loginKey":"Key2"},
        {"agent":"Chrome32","OS":"Chrome OS","IP":"999.999.299.391","loginKey":"Key3"}
       ]
    },
    "Username2": {
      "logins":[
        {"agent":"Safari 7","OS":"Mac OS X","IP":"999.399.999.991","loginKey":"Key1"},
        {"agent":"Safari","OS":"IPhone 5","IP":"999.199.949.191","loginKey":"Key2"}
       ]
    }
}


When you want to show the user where he is logged in, just display the logins for his account. In your case, you could just check if there is already a session key in the db for the user, inform him and do other things.

Note that using a SQL based db could affect the performance of your website since you'll also need to check if the user visits subsequent pages. Or, you could just do this for when the user logs in only.
 
Share this answer
 
Comments
PrissySC 30-Mar-14 6:44am    
Oh, I wasn't very clear, this is not my site per se, but another service. I want to create a script that reads the IE on the client machine. As it stands, the app that is run in the cloud through IE allows multiple session logins on the same client machine. I want to run this check independent of the app because the provider will not.
Akinmade Bond 30-Mar-14 9:05am    
Why is this a problem? I'm logged in on my phone to CP and on my PC and many other sites allow this too. So, I don't see how this is a serious problem for your client.

Although, you could run a script that checks if the user is currently logged in on the machine using AJAX or CURL by trying to access a restricted page and reading the results. If you get the login page or any other error, the user is not logged in, else you redirect the user to a "You're already logged in page."
PrissySC 3-Apr-14 16:46pm    
Database access and merchant cart. Not sure why it is a problem, but it is. I just wanted to stop multiple log-ins on multiple tabs/IE open windows to stop this. The "don't do that" is not working - as you can imagine. I think it boils down to the one workstation and the session is corrupted by the multiple log-ins. I really need more time to narrow down the "why" of it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900