Skip to main content
June 20, 2012
Question

Grabbing Cookies for PHP?

  • June 20, 2012
  • 2 replies
  • 614 views

I'm still some what a beginner with CF so take it easy on me. I currently have a web site that uses MyBB as a forum. My homepage/portal is programmed in coldfusion. Currerntly it is gathering post information so it shows latest posts and comments. I want users to be able to login here as well and then it redirect back to the homepage/portal. The login script works flawlessly, however, once someone logs in I want to be able to retrieve the cookies from myBB and then output the current user's username, userid, email, ect.

How would I retrieve the cookies information and then output the information with coldfusion?

Thanks!

    This topic has been closed for replies.

    2 replies

    Participant
    June 25, 2012

    I also agreed with Peter Freitag.  For outputing the cookie's information  in cf code, use <cfoutput> tag. The syntax is

    <cfoutput>#cookiesname#</cfoutput>.

    For see the cookie name for the revision <cfdump> tag is used in the code.Syntax is

    <cfdump var="#cookiename#">

    Thanks

    Bipin

    pete_freitag
    Participating Frequently
    June 21, 2012

    You can display any cookie in ColdFusion like this:

    <cfoutput>

    #cookie.cookiename#

    </cfoutput>

    If you want to see all the cookie names you can do this:

    <cfdump var="#cookie#">

    Hope that helps.

    --

    Pete Freitag

    Foundeo Inc. | HackMyCF.com