Professional Web Applications Themes

how to show the user is online and logged in? - Coldfusion - Advanced Techniques

i am making a community page, in the member browsing page, i want to show the surfer that whether the user is online and logged in, i am using #Session.Memberid# to memorized the member's id, can anyone help me?...

  1. #1

    Default how to show the user is online and logged in?

    i am making a community page, in the member browsing page, i want to show the
    surfer that whether the user is online and logged in, i am using
    #Session.Memberid# to memorized the member's id, can anyone help me?

    HongKongSunny Guest

  2. #2

    Default Re: how to show the user is online and logged in?

    Two ways...

    Open up the new CFMX7 doentation and look at Application.cfc chapter, you
    will see all you need to do that kind of thing.

    Otherwise, in the good old time I had to build an application level array of
    structures containing my users data (id, name, lastactivitytime). I
    established my timeout to be, say, 15 minutes. On each request from a user I
    update his lastactivitytime... then I look at all the users in this array to
    delete each entry with a lastactivitytime greater than 15 min from now. This
    is a patch...

    Another more precise method... you could also put an "hidden" iframe of 1px
    (0px or style hidden won't work in NS, so 1 px is good) on each page and put a
    meta refresh of, say, 30 seconds... so that each 30 seconds the page in the
    iframe, sessiontracker.cfm would refresh this user activityTime in Application
    scope. For even more fun you could have this cfm page return the list of users
    logged in and use it to refresh the innerHTML of your DIV showing that list (in
    the main page, not the iframe page)... dynamically. Easy enough in JS.

    So, you have 3 ways of doing it. Application.cfc is the more precise... the
    last one is the coolest.

    ScottyMTL Guest

  3. #3

    Default Re: how to show the user is online and logged in?

    Forgot... you can also run a scheduled task each so many minutes to check "expired" sessions instead of just counting on each user request. But the best way remains using Application.cfc
    ScottyMTL Guest

Similar Threads

  1. Get the current logged in user name
    By Imran in forum ASP.NET Security
    Replies: 8
    Last Post: August 29th, 03:54 AM
  2. Replies: 4
    Last Post: August 17th, 10:45 PM
  3. Best way to remember a logged in user
    By Joshua Beall in forum PHP Development
    Replies: 16
    Last Post: December 31st, 03:21 AM
  4. Logged in user?
    By Betina Y Andersen in forum ASP
    Replies: 7
    Last Post: September 22nd, 02:47 PM
  5. asp get Table Column ( Show Active Users Names Logged On )
    By Wayne & Carr in forum ASP Database
    Replies: 8
    Last Post: July 18th, 05:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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