Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default cfcookie help

    hello, i starting coding in coldfusion a week ago and i am really enjoying it
    so far. However, i finally completed my hardest task yet by bulding a 1-10
    ratign system for individual pages. That application works to perfection but
    when i decided to implement cookies for one time use per user, i hit a road
    block.

    in the ratingscript file i made, after it inserts the vote and page into the
    database, it sets a cookie named rated with a value of the previous page: (
    <cfcookie name="rated" value="#CGI.HTTP_REFERER#" expires="never" />). This
    worked fine for a while until i realized that once the person rates another
    page, it changes the cookie so that he can go back and rate the other. I then
    tried to set the cookie name to #CGI.HTTP_REFERER#, but then there was no way
    to check the cookie without messed up variables (cfif
    #COOKIE.#fullpagename##???????). Can someone please come up with an alternate
    way of solving this problem and allowing a user to vote on multiple pages only
    once?? It would be greatly appreciated

    casagrande8289 Guest

  2. Similar Questions and Discussions

    1. cflogin and cfcookie in application.cfm - second postplease help
      Hi, I just upgraded our CF5 to CFMX7 and having problem getting the cfcookied to work properly with the new cflogin tag in application.cfm. I...
    2. cflogin and cfcookie in application.cfm
      Hi, I just upgraded our CF5 to CFMX7 and having problem getting the cfcookied to work properly with the new cflogin tag in application.cfm. I...
    3. CFCookie and Select
      I am trying to set a CFCookie with the value from a List/Menu. I have the following code: <form name="form1" method="post" action=""> <p>...
    4. CFLOCK / CFCOOKIE and SubDomains with a _
      This is a very odd problem.... We have a site that uses a wildcard subdomain, as many different agents use the same dynamic site. Whenever you...
  3. #2

    Default Re: cfcookie help

    You could save a simple list to the cookie of all the ID's that the user has
    reviewed.

    <cfparam name="cookie.rated" default="">
    <cfcookie name="rated" value="#listappened(cookie.ratesd,ThisID)#"
    expires="never" />

    and then search the list to evaluate is they have rated the item

    cfif isdefined("cookie.rated") AND ListFind(cookie.rated, ThisID)
    --dont allow vote
    cfelse
    --allow vote

    (thisID is the ID of the item beign voted on)



    stpaz 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