Can I perform a function when user leaves site?

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

  1. #1

    Default Can I perform a function when user leaves site?

    I need to update a database record when a User closed his browswer or leaves the site. Is this possible? If so, how would I do that?
    Scooby Doobie Doo Guest

  2. Similar Questions and Discussions

    1. Capturing event when user leaves a cell?
      Does anyone know what event this might be? In a datagrid, user clicks on Edit on a row, types data in the first cell, then goes to the next cell. ...
    2. Detecting when a user leaves a page
      Hello, I need (I think) to find a way of detecting when a user leaves a web-page; by hitting a link or the Back button, by typing into the...
    3. site function
      Hello, I am building my first flash site. I would like to see if there are any suggestions for it. The logos & print pages have not been transfered...
    4. #24858 [Opn->Bgs]: proc_open() leaves zombie processes if user cancels page load
      ID: 24858 User updated by: jr-php2 at quo dot to Reported By: jr-php2 at quo dot to -Status: Open +Status: ...
    5. #24858 [NEW]: proc_open() leaves zombie processes if user cancels page load
      From: jr-php2 at quo dot to Operating system: Red Hat Linux 9.0, kernel 2.4.21 PHP version: 4.3.2 PHP Bug Type: Program...
  3. #2

    Default Re: Can I perform a function when user leaves site?

    The only way to safely achieve this is to crate a table and set an
    identifying value plus timestamp within that table when ever a user
    visits any given page.

    You'll need to create a background scheduled task to check this table
    every couple of minutes or so and if any of the entries timestamp are
    older than a specified time, then the user is no longer on the site and
    you can perform whatever task you want.

    It's up to you to determinme when a user is no longer at your site which
    could be the same as the life of a session.


    Scooby Doobie Doo wrote:
    > I need to update a database record when a User closed his browswer or leaves the site. Is this possible? If so, how would I do that?
    --

    Don Vaillancourt
    Director of Software Development
    WEB IMPACT INC.
    phone: 416-815-2000 ext. 245
    fax: 416-815-2001
    email: [email]donv@web-impact.com[/email] <mailto:donv@webimpact.com>
    web: [url]http://www.web-impact.com[/url]
    address: [url]http://www.mapquest.ca[/url]
    <http://www.mapquest.com/maps/map.adp?country=CA&addtohistory=&formtype=address& searchtype=address&cat=&address=99%20Atlantic%20Av e&city=Toronto&state=ON&zipcode=M6K%203J8>
    Web Impact Inc. <http://www.web-impact.com>
    This email message is intended only for the addressee(s) and contains
    information that may be confidential and/or copyright.

    If you are not the intended recipient please notify the sender by reply
    email and immediately delete this email.

    Use, disclosure or reproduction of this email by anyone other than the
    intended recipient(s) is strictly prohibited. No representation is made
    that this email or any attachments are free of viruses. Virus scanning
    is recommended and is the responsibility of the recipient.
    Don Vaillancourt Guest

  4. #3

    Default Re: Can I perform a function when user leaves site?

    On 2005-06-09 10:18:09 -0500, "Scooby Doobie Doo"
    <webforumsuser@macromedia.com> said:
    > I need to update a database record when a User closed his browswer or
    > leaves the site. Is this possible? If so, how would I do that?
    If you're on CFMX 7 you can use the new OnSessionEnd event in your
    Application.cfc:
    [url]http://tinyurl.com/7v2sw[/url]

    Matt
    --
    Matt Woodward
    [email]mpwoodward@gmail.com[/email]
    Team Macromedia - ColdFusion

    mpwoodward *TMM* 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