avoid logging same user again...

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default avoid logging same user again...

    the system consist of many wireless pocket pc connected to a portatil computer
    which has the access point and is the server which counts the data; every
    inventory employee has one so they can move freely around the store and make
    the count, every pocket pc counts with a reader system, so then submit the data
    to the server and everything is ok....

    so the problem is, how can avoid 2 users accessing with the same username?

    my boss was running the system and everything was ok until he got another
    pocket pc, and tried to login with the same user an to my surprise the
    coldfusion server give him permission withouth problem...

    i am using the cflogin and cfloginuser tag, so i was convinced coldfusion mx
    did it automatically, is there a way to avoid what i mentioned early about 2
    accesing with same username at same time?

    thx for any advice or help!

    AcidGuy Guest

  2. Similar Questions and Discussions

    1. Logging a user
      Hey all, Question - is there any way to "log" the people who have logged in to use a CF App? Here is my scenario - I am creating a CF app that...
    2. How can I avoid NaN
      When my .swf loads the variables from the .txt file (days=2&hours=17&minutes=10&seconds=56), the swf file starts and shows seconds "56" for one...
    3. How to avoid this
      Hi, I have a project where when the user scroll over the buttons a picture or movie display on the screen. All works fine, but moving between...
    4. logging user visit
      I am building an ASP application, in this application, one of the functions is that I have to know exactly how long a user has used a certain page...
    5. Avoid SmartNavigation
      I've done some investigating about various problems with the SmartNavigation feature. It seems to me that the general consensus is to avoid...
  3. #2

    Default Re: avoid logging same user again...

    Taking verbiage directly from the "Macromedia Coldfsuion MX Web Application
    Construction Kit"

    "It is up to you to ensure that each possible combination of NAME and PASSWORD
    is unique (this is almost always the case anyway, an application should never
    allow two users to have the same username and password). the best practice
    would be to make sure that some kind of unique identified (Such as the
    ContactID) be used as part of the NAME, just to make sure that ColdFusion
    understands how to distinguish your users from one another".

    So, in short it is up to you to prevent these multiple logins. One approach
    is to use the SessionTracker object available in CFMX+.

    <cfapplication name="TestApp" clientmanagement="yes" sessionmanagement="yes"
    sessiontimeout="#CreateTimeSpan(0,0,20,0)#">
    <cfscript>
    tracker = createObject("java", "coldfusion.runtime.SessionTracker");
    sessions = tracker.getSessionCollection("TestApp");
    </cfscript>
    <cfdump var="#sessions#" label="Session Collection Information">
    <cfabort>



    BSterner Guest

  4. #3

    Default Re: avoid logging same user again...

    so, is there a way to access to the properties of each object like cfdump do it
    ?

    so i can check for a existing username in the tracker and then avoid 2 users
    logging in the same session

    thx for any help!

    AcidGuy Guest

  5. #4

    Default Re: avoid logging same user again...

    One option is to just loop through the structure returned by
    'tracker.getSessionCollections()'. Like...



    <cfscript>
    duplicateLogin = false;
    for (keyName in sessions)
    {
    if (FORM.username eq sessions[keyName].username) //assumes there's a session
    variable named 'username'
    {
    duplicateLogin = true;
    break;
    }
    }

    if (duplicateLogin) ...
    //Code to handle duplicate login goes here
    </cfscript>

    BSterner Guest

  6. #5

    Default Re: avoid logging same user again...

    i could the names of the people connected, but still some bad things remain
    there...

    when 1 user is logged the system show 2 session, thats what i could see with
    cfdump, when 2 users go and login, then appear the right 2 sessions, and the
    strange session dissapear...

    so when the strange session is opened, the system of course cant get the
    INOMBRE property which si into a structure called SESIONACTUAL so the server
    throws this error :

    Element SESIONACTUAL.INOMBRE is undefined in a Java object of type class
    coldfusion.runtime.MemorySessionScope referenced as

    this is really weird since i have been spending a lot of energy trying to make
    this works...
    so i used the isDefined() to know if the structure and the variable exists or
    not and the server throws another error, then StructKeyExists to check if
    SESIONACTUAL exists so then the code is able to avoid the strange and the
    system throws another error...

    this is really weird, the good is that it feel one step closer, so the
    problem is to deal with demonic errors ...

    any help is apreciated!

    AcidGuy Guest

  7. #6

    Default Re: avoid logging same user again...

    can you create a field in your db that would tell you when your login ro log out?
    jorgepino Guest

  8. #7

    Default Re: avoid logging same user again...

    huh, at the end i could do it making a similar aproach with the code you gave me

    here there is a nice article that can help someone :
    [url]http://coldfusion.sys-con.com/read/41900.htm[/url]

    thx for the support!

    AcidGuy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139