Tracking users in the Application.cfc, please help

Hello;
I wrote a small tracking system for my web site. I am trying
to upfrade it to work in CF 8. Here is what I am doing.
I had this code on the index.cfm page of my site. I am
attempting to move it to the Application.cfc file. When I do, it
registers in the DB every time the user hits a page or clicks a
link. I don't want it to do that. I do want it to tell me when they
hit the site, and if I can what page they came in on.
Here is my code:
<cfquery name="tracking" datasource="my-DB"
dbtype="ODBC">
INSERT INTO tracking (REMOTE_ADDR, HTTP_USER_AGENT,
TRACK_DATE, PageID)
VALUES('#REMOTE_ADDR#', '#HTTP_USER_AGENT#',
#CreateOdbcDateTime(now())#)
</cfquery>
My pageID is where I want the information on what page the
user came in on to go.
I placed teh query inside a session function code, but it
doesn't work at all right now, I need to limit the hits counted by
the Application.cfm, if I place it inside the area of the app that
is for global variables, it adds info to the DB everytime they
click a link and I don't want that. As for the entry page of the
user, I am trying to make it so if someone enters the site lets say
on the about.cfm page, that is added to the db and so on. Is this
possible? If so how would I do that?
Here is my application.cfc code so far:
<cfcomponent output="false">
<cfset THIS.name = "my-web">
<cfset this.sessionManagement="yes">
<cfset this.clientManagement=true>
<cffunction name="onApplicationStart" returntype="boolean"
output="false">
<cfset APPLICATION.appStarted = now()>
<cfreturn true>
</cffunction>
<cffunction name="onApplicationEnd" returntype="void"
output="false">
<cfargument name="appScope" required="True">
<cflog file="#THIS.name#" text="App ended after
#dateDiff('n' , ARGUMENTS.appscope.appStarted,now())# minutes.">
</cffunction>
<cffunction name="onSessionStart" returntype="query"
output="true">
<cfquery name="tracking" datasource="creative"
dbtype="ODBC">
INSERT INTO tracking (REMOTE_ADDR, HTTP_USER_AGENT,
TRACK_DATE)
VALUES('#REMOTE_ADDR#', '#HTTP_USER_AGENT#',
#CreateOdbcDateTime(now())#)
</cfquery>
</cffunction>
<cffunction name="onRequestStart" returntype="boolean"
output="true">
<cfset request.datasource = "my-db">
<cfset sitePath = "
http://www.myweb">
<!--- this is where I was putting the tracking code and it
added to the DB everytime someone clicked a link. not what I want
--->
<!--- Start True Url Variables --->
<cfloop
list="#removeChars(cgi.path_info,1,len(cgi.script_name))#"
delimiters="/" index="variableSet">
<cfscript>
variableName = "url." & listGetAt(variableSet,1,'.');
expression = listGetAt(variableSet,2,'.');
</cfscript>
<cfparam name="#variableName#" default="#expression#">
</cfloop>
<!--- Finish True Url Variables --->
<cfreturn true>
</cffunction>
</cfcomponent>
Thank you.
Phoenix

I did a dump and got it to error out, so it is recognizing
the session, but it doesn't add any info to the DB. I also had to
change it, I had it like this:
<cffunction name="onSessionStart" returntype="query"
output="true">
<cfquery name="tracking" datasource="my-db"
dbtype="ODBC">
INSERT INTO tracking (REMOTE_ADDR, HTTP_USER_AGENT,
TRACK_DATE)
VALUES('#REMOTE_ADDR#', '#HTTP_USER_AGENT#',
#CreateOdbcDateTime(now())#)
</cfquery>
</cffunction>
Changed it to this:
<cffunction name="onSessionStart" returntype="any"
output="true">
<cfquery name="tracking" datasource="creative"
dbtype="ODBC">
INSERT INTO tracking (REMOTE_ADDR, HTTP_USER_AGENT,
TRACK_DATE)
VALUES('#REMOTE_ADDR#', '#HTTP_USER_AGENT#',
#CreateOdbcDateTime(now())#)
</cfquery>
</cffunction>
it was erroring on the query attribute before in the session
function. Even that change didn't get it to work properly.

Similar Messages

  • TS3376 I was able to use the findmyiphone app last week, but now I have been getting an error message "Can't load findmyiphone.  There was a problem loading the application."  please help as we are trying to locate an ipod with pics of a no deceased loved

    I was able to use the findmyiphone app last week, but now I have been getting an error message "Can't load findmyiphone.  There was a problem loading the application."  please help as we are trying to locate an ipod with pics of a no deceased loved one.

    Had the same problem and the same message --  was suddenly unable to access icloud apps on my pc, also using Windows 7 and Internet Explorer. After several days of pulling my hair out, decided to try a different browser and was able to get in by using Firefox instead of Internet Explorer.  Hope this helps. 

  • Permissions Issue causes Dreamweaver CS6 Menus to Crash the Application. Please Help!

    I recently upgraded Adobe Web Premium CS5 to CS6. All of the include applications seem to run as expected, except for Dreamweaver which crashes when many of the pallet menu options are clicked.
    The application when tested on a new user account will operate without crashing, and after contacting Adobe support, they referred me to the Apple/Mac Community for help, since they want to identify the issue as a permissions problem associated with my user account on my MacBook Pro.
    With the many levels of permissions in many different locations, I'm at a loss as to what changes might be necessary to fix the problem. I did upgrade Java to the latest release in the hope that it would help, but it did not.
    Any isight into this issue would be appreciated. After reading throught the Adobe Forum related to this application, I found other rmenu issues that were similar but manifested in slightly different ways, like certain options were not visible and users assumed that they were removed in the latest release.

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. You can demote it back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’renot going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Large attachment in mail stalls the application. Please help!

    I accidentally tried to send a 10mb email. I realized the issue immediately and tried to delete the email from Outbox, which didn't show up till later. And when it did I deleted the large email in the Outbox. Or so I thought.
    Next, my Internet got knocked out at some point and I had to reconnect.
    Now, I'm back on line. Mail is not working at all on its own. When I try to send a test mail to myself, the Sent button gets busy and it reproduces the same copy of the 10mb email under On My Mac category and in Sent Messages. And my test email would sit in the Outbox.
    Meanwhile nothing else is working. I have no mail coming in and obviously cannot send anything out. Please help.
    BTW, I have already tried to go into Finder/home/library/Mail and tried deleting Outbox.mbox and Sent Messages.mbox. When I relaunch Mail, the same problem persists.
    If you know how to fix this, I would love to know. Thanks!

    Hello leaflet:
    Try a couple of things:
    Select the mailbox giving you problems. Select mailbox>rebuild from the drop down menu.
    If that does not help, move the preference file (com.apple.mail.plist) to the trash. Do not empty the trash just yet. Restart mail and see if the problem is corrected. You will need to reenter your personal preferences.
    Barry

  • I have 2 users on my Mac I want to merge the photo libraries please help!

    I have 2 users on my Mac I want to merge the photo libraries please help!

    What version of iPhoto? Do yuo hae Aperature 3.3? With iPhoto 9.3 and Aperature 3.3 you can merge iPhoto libraries - you also can do it with the paid version of iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ - 
    LN

  • I am trying to buy an app (Aperture). I don't see a "buy" icon in the app store. If I go to Apple site, there is a buy icon but when I click it, I get a dialogue box saying the link needs to be opened with an application. Please help. Thanks.

    I am trying to buy an app (Aperture). I don't see a "buy" icon in the app store. If I go to Apple site, there is a buy icon but when I click it, I get a dialogue box saying the link needs to be opened with an application. Please help. Thanks.

    Hi ...
    Installing the OS X Lion Update 10.7.3 (Client Combo) will reinstall the App Store for you.
    Restart your Mac after the combo is installed then try purchasing Aperture.

  • Error "Some of the application components are missing from the Application directory, Please reinsta

    I downloaded Photoshop Extended about a week ago... the second time I opened it, an error message came up saying "Some of the application components are missing from the Application directory, Please reinstall the application."  So I uninstalled it, then re-intalled it.  I was able to open it successfully after that - and I used it once.  I have just gone to open it again and it is reading the same error.  This is very frustrating - why is it doing this?  I don't want to have to unintall and reinstall everytime I want to use it.  Please help

    I want to bump this topic, again. So far the clues I've found are that there may be problems when the program was installed in one user account, and used in a different one. Perhaps there is a language setting, too. Can anyone give tips on this error for Mac, specifically Lion OS?

  • PS CS4 64-bit (in Web Premium CS4) on Win 7 PC.  I did a duplicate file check on my hdd and deleted dup files. Now I get "Some of the application components are missing from the Application directory, Please reinstall.."

    PS CS4 64-bit (in Web Premium CS4) on Win 7 PC.  I did a duplicate file check on my hdd and deleted dup files. Now when I try to run PS 64-bit I get "Some of the application components are missing from the Application directory, Please reinstall the application." When I do this, it seems to install correctly until the very end, then it says "Installation Complete With Errors", and when I try to run I get the same 'component missing message'. What can I do? PS 32 bit runs fine. Some of the other applications ib Web Premium say the shortcut has been changed or removed. I appreciate your help...Thank you

    Best advice I can think of is to uninstall and run the Clean Script from here.
    Adobe - Adobe CS4 Clean Script

  • Hi.. i forgot my apple id and password.. i cant activate my ipod touch.. but here's the serial number, *********** please help me.. thanks

    hi.. i forgot my apple id and password.. i cant activate my ipod touch..
    but here's the serial number, *************** please help me.. thanks
    <Edited by Host>

    We are fellow users here on these forums, you're not talking to iTunes Support nor Apple - I've asked the hosts to remove your iPod's serial number address from your post.
    Only you can activate your iPod by typing in your id and password, or you can remove a device from your account via http://icloud.com . If you can't remember your account id then do you have any of its downloads on your computer's iTunes : Recovering a forgotten iTunes Store account name ? If not then you could try http://iforgot.apple.com . You can also reset your password via the 'iforgot' site, or you can contact Support in your country and they should be able to reset your password (as long as you can prove your id and that it's your account) : Apple ID: Contacting Apple for help with Apple ID account security
    iOS 7 and activation lock : iCloud: Find My iPhone Activation Lock in iOS 7
    What if I forget my Apple ID password?
    If you forget your password, you can reset it at My Apple ID (appleid.apple.com) or by contacting Apple Support and verifying your identity. Once your password has been reset, it will work normally with Find My iPhone and Activation Lock.
    If you forget your password and cannot reset it, you will lose access to your Apple ID and may be unable to use or reactivate your device. To help prevent this, visit My Apple ID periodically to review and update your account information.

  • I have made a webpage in HTML with several links to JPGs / GIFs. The text matter opens perfectly but not the images. Please help me

    I have made a web page in HTML with several links to JPGs / GIFs. While text matter opens up perfectly, but not the images. Please help me.
    == This happened ==
    Every time Firefox opened
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; CTS Version; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    URL of that web page?

  • HT2521 A pop up window in my safari is not closing. Even after several clicks on OK it keeps popping up. And the open window is not allowing me to use the Safari nor is it allowing to restart/Shutdown the Mac. Please help me rectify this error.

    A pop up window on my Safari does not close even after several clicks on OK... this window keeps popping up and is not allowing using the safari nor is it alowing to close the browser. The open Safari is also not allowing to restart or shutdown the notebook. Please help me rectify the problem.

    Force Quit .
    Press command + option + esc keys together at the same time.    Wait.
    When Force Quit window appears, select  Safari, if not already.
    Press Force Quit button at the bottom of the window.      Wait.
    Application will quit.
    If this does not help, press the power button for 7 or more seconds.
    Computer will shut down.
    Restart.
    Hold the shift key down and launch Safari.
    Best.

  • How to access the activities created by an enduser especially when the enduser has left the organization?Please help me out with the possible solution

    How to access the activities created by an end user especially when the end user has left the organization?Please help me out with the possible solution

    Hi Ramesh,
    In the web UI we have business role IC_manger where you can search the activities based on employee responsible and you can use business transaction assignment functionality to assign those activities to any  other end user or team.
    Else you can also use Agent inbox functionality if you have configure the agent inbox for those activity.
    Hope this helps solving your query

  • I cant remmber the restrictions passcode please help me for important

    i cant remmber the restrictions passcode please help me for important

    If you cannot remember the restrictions passcode, the only alternative is to restore the phone as a new device. Trying to restore from backup will only put the passcode back on. There is no other alternative. See the user manual. http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • HT202152 I have tried updating my apps and software but it says my startup disk or hard disk is full. I deleted a lot of files and apps but they won't be erased from the trash. Please help

    I have tried updating my apps and software but it says my startup disk or hard disk is full. I deleted a lot of files and apps but they won't be erased from the trash. Please help.

    For information about the Other category in the Storage display, see this support article. If the display seems to be inaccurate, try rebuilding the Spotlight index.
    Empty the Trash if you haven't already done so. If you use iPhoto, empty its internal Trash first:
              iPhoto ▹ Empty Trash
    In Photos:
              File ▹ Show Recently Deleted ▹ Delete All
    Do the same in other applications, such as Aperture, that have an internal Trash feature. Then restart the computer. That will temporarily free up some space.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation—not the mythical 10%, 15%, or any other percentage. You also need enough space left over to allow for growth of the data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) or GrandPerspective (GP) to explore the volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one. Note that ODS only works with OS X 10.8 or later. If you're running an older OS version, use GP.
    Deleting files inside a photo or iTunes library will corrupt the library. Changes to such a library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS or GP can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    Install the app in the Applications folder as usual. Quit it if it's running.
    Triple-click anywhere in the corresponding line of text below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C.
    For ODS:
    security execute-with-privileges /A*/OmniDiskSweeper.app/*/M*/* 2>&-
    For GP:
    security execute-with-privileges /A*/GrandPerspective.app/*/M*/* 2>&-
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Paste into the Terminal window by pressing command-V. You'll be prompted for your login password.
    The application window will open behind other open windows. When you scan a volume, the window will eventually show all files in all folders, sorted by size. It may take a few minutes for the app to finish scanning.
    I don't recommend that you make a habit of doing this. Don't delete anything as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with the app, quit it and also quit Terminal.

  • My battery on my iphone theree is growning and it turns off around 80% then in order for it to turn back on i need to put it on the charger , somebody please help me i need to fix this is there anyway  ican??

    my battery on my iphone three is growning and it turns off around 80% then in order for it to turn back on i need to put it on the charger , somebody please help me i need to fix this is there anyway  ican?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    If the issue persists, then take the device to Apple for evaluation.
    FYI, Apple will not replace the battery without first doing basic troubleshooting or testing the battery.

Maybe you are looking for

  • Can't send email from my Mac Book Air using my Yahoo account!

    I have set up my Yahoo account on my Mac Book Air but I am unable to send mail using Yahoo.  The message goes to the outbox on the Mac but is not received by the recipient.  It does not go to the sent box in Yahoo.  Can anyone help with this please?

  • Laserjet CP1025nw HP system tray has stopped working

    I bought this printer a month ago and about a week ago I started getting the error"HPCP1020SM.exe (64 bit) has stopped working." then click close then"HP system tray has stopped working." appears click close. the printer will still print but these er

  • Open PDF in Specific Page

    Hi =) Suppose I have a big pdf, let's say, with 500 pages. I want to know if it can be opened in a specific page (this page can change). How can I do that? Is it possible? Besides that, if I'm looking for a specific word, is it possible to open the p

  • Updates not functioning correctly

    Whenever I try to download system updates from the APP Store, here are the screens I get: I've rebuilt the OS because I'm also having trouble with Mail.  Is this a known problem or am I on my own. Also, I get the notification that iMovie fails to dow

  • Recording from Record Player to Air

    I would like to record my records(vinyl) to my Macbook Air - iTunes. The record player is not a USB type device that they have these days.  The record player does have a built in pre-amp.  How do I do this through the MacBook Air? Thanks for your hel