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

  1. #1

    Default Creating cookies

    Is there some new way to create cookies in cfm 6.1 I used this code before
    in cfm 5.0 and it worked great. <DBCOOKIE NAME='OwnerID'
    VALUE='#session.OwnerID#' EXPIRES=never> <DBCOOKIE NAME='ContactID'
    VALUE='#session.ContactID#' EXPIRES=never>
    <cfoutput>#cookie.ContactID#</cfoutput><cfabort> After running this code I
    get an error that says 'Element CONTACTID is undefined in COOKIE. ' what
    gives?

    mikey999 Guest

  2. Similar Questions and Discussions

    1. creating shared folder location hanges when creating a review
      Hi All, I am using Acrobat Pro 8.1.2 for Mac. When I try to create a document for review, I get through all the steps until I get the pop up...
    2. Creating Cookies or Variables for Authentication
      Hope someone can help on this! I have been charged with revamping the online presence for a magazine. Aside from the public access for the site,...
    3. Issues creating cookies
      I seem to not be able to make cookies on my site. You can see in this example http://www.getf.org/test.cfm That the cookies are created and they...
    4. Cookies... Help Please !
      In article <2lg5ivcd5n5t8ao8fp2050rc65sei8uai7@4ax.com>, Fred < @> wrote: Does php allow this? I would use strcmp.
    5. cookies in asp
      If it's a real cookie, you can get it with php into the cookie vars.. If it's an asp session, forget it... "Carlos Castillo"...
  3. #2

    Default Re: Creating cookies

    How about CFCOOKIE?

    <cfcookie
    name = "cookie_name"
    value = "text"
    expires = "period"
    secure = "Yes" or "No"
    path = "url"
    domain = ".domain">
    paross1 Guest

  4. #3

    Default Re: Creating cookies

    Ok so I must be doing something wrong. Here is my test one
    [url]http://www.getf.org/test.cfm[/url] it shows the code I am using and it sets the
    cookies ok. But then look at test 2 [url]http://www.getf.org/test2.cfm[/url] all this
    page has on it is <br><br> I get this result. <br> <b><cfoutput>OwnerID cookie
    = #COOKIE.OwnerID#</cfoutput><br> <b><cfoutput>ContactID cookie =
    #COOKIE.ContactID#</cfoutput> <cfabort></b> But I get this error 'Element
    OWNERID is undefined in COOKIE.' It's like it sets the cookie at first but o
    nthe second page the cook dose not work.

    mikey999 Guest

  5. #4

    Default Re: Creating cookies

    Ok so I must be doing something wrong. Here is my test one
    [url]http://www.getf.org/test.cfm[/url] it shows the code I am using and it sets the
    cookies ok. But then look at test 2 [url]http://www.getf.org/test2.cfm[/url] all this
    page has on it is I added spaces so it would show up here. <br><br> I get this
    result. <br> <b>< cfoutput>OwnerID cookie = #COOKIE.OwnerID#</cfoutput><br>
    <b>< cfoutput>ContactID cookie = #COOKIE.ContactID#</cfoutput> < cfabort></b>
    But I get this error 'Element OWNERID is undefined in COOKIE.' It's like it
    sets the cookie at first but o nthe second page the cook dose not work.

    mikey999 Guest

  6. #5

    Default Re: Creating cookies

    You aren't trying to use CFLOCATION , are you?

    Phil
    paross1 Guest

  7. #6

    Default Re: Creating cookies

    nope I found out about that issue a long time ago. But I did find out why this
    was not working. The domain was set like domain='getf.org' when it has to be
    set as domain='.getf.org' you have to have the extra . in front of the domain.
    One book I read did not show this as the example but another book this show
    this. So I was able to fix it I think. Still playing arround but this looks
    better now.

    mikey999 Guest

  8. #7

    Default Re: Creating cookies

    You might try dumping the cookie scope on the page that sets (or gets) your cookie, to help your troubleshoot:
    <cfdump var="#cookie#">

    trbaker 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