House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Grabbing PHP cookies

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
<cfoutput>#COOKIE.name_of_cookie#</cfoutput>
Edward Chanter
06/21/12 10:43 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 10:41 AM

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. Currently 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!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Edward Chanter
06/21/2012 10:43 AM

<cfoutput>#COOKIE.name_of_cookie#</cfoutput> I think that's what you need or maybe I'm oversimplifying it ;-) > 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. Currently 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 ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
06/21/2012 10:43 AM

Cookies are per domain - so you just... use em. If you have your forums in the same domain, when you hit the CFM, just access them as cookie.whatever. On Thu, Jun 21, 2012 at 9:39 AM, Cory Fail <juturnaphoto@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
06/21/2012 10:49 AM

> 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. Currently 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? To add to what Edward and Ray have already said, it may be the case that the cookies are host-specific, rather than domain-specific, so you'll need to see if they exist at all when someone visits your CF application. For example, if you had two different URLs: mybb.example.com www.example.com those two are within the example.com domain, and therefore can share cookies. But, it's possible that the myBB application set the cookies so that they're only returned to mybb.example.com. In that case, you might have to modify the myBB code to set those cookies as domain-wide. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 02:15 PM

>> > I'm still some what a beginner with CF so take it easy on me. I Thanks for the info. However, I have no idea how to start so that a variable only shows the logged in users information. Instead whats currently on the database itself. Would this be done with a session? Can someone give me some example code to start me off? Thanks a lot guys!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 02:14 PM

Thanks for the info. However, I have no idea how to start so that a variable only shows the logged in users information. Instead whats currently on the database itself. Would this be done with a session? Can someone give me some example code to start me off? Thanks a lot guys!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jordan Michaels
06/21/2012 02:37 PM

One of the greatest tools in ColdFusion is the CFDUMP tag. Try this: <cfdump var="#cookie#"> ...and see what's there! =) Hope this helps! Warm Regards, Jordan Michaels On 06/21/2012 11:12 AM, Cory Fail wrote: > > Thanks for the info. However, I have no idea how to start so that a variable only shows the logged in users information. Instead whats currently on the database itself. Would this be done with a session? Can someone give me some example code to start me off? > > Thanks a lot guys!

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 02:51 PM

> One of the greatest tools in ColdFusion is the CFDUMP tag. > > Try this: > > <cfdump var="#cookie#"> > ... ----- Excess quoted text cut - see Original Post for more ----- CFGLOBALS    urltoken=CFID#=3654908&CFTOKEN#=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE&jsessionid#=84306bffa4d850206c356392d7a5b4c34316#lastvisit={ts '2012-06-21 19:05:49'}#timecreated={ts '2012-06-21 19:02:42'}#hitcount=7#cftoken=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE#cfid=3654908# CFID   3654908 CFTOKEN   5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE COOKIE   [empty string] JSESSIONID   84306bffa4d850206c356392d7a5b4c34316 Thats what I get in my dump.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 02:51 PM

> One of the greatest tools in ColdFusion is the CFDUMP tag. > > Try this: > > <cfdump var="#cookie#"> > ... ----- Excess quoted text cut - see Original Post for more ----- This is what is returned. CFGLOBALS    urltoken=CFID#=3654908&CFTOKEN#=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE&jsessionid#=84306bffa4d850206c356392d7a5b4c34316#lastvisit={ts '2012-06-21 19:05:49'}#timecreated={ts '2012-06-21 19:02:42'}#hitcount=7#cftoken=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE#cfid=3654908# CFID   3654908 CFTOKEN   5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE COOKIE   [empty string] JSESSIONID   84306bffa4d850206c356392d7a5b4c34316

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 02:54 PM

Sorry for the double posts.. It didnt seem like it was sent. ----- Excess quoted text cut - see Original Post for more ----- ... ----- Excess quoted text cut - see Original Post for more -----   urltoken=CFID#=3654908&CFTOKEN#=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102A> CD5F1CE&jsessionid#=84306bffa4d850206c356392d7a5b4c34316#lastvisit={ts > '2012-06-21 19:05:49'}#timecreated={ts '2012-06-21 19:02:42'}#hitcount=7#cftok> en=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE#cfid=3654908# > CFID   3654908 > CFTOKEN   5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE > COOKIE   [empty string] > JSESSIONID   84306bffa4d850206c356392d7a5b4c34316

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alan Rother
06/21/2012 05:46 PM

Looking at your dump, those are pretty much all ColdFusion created cookies. 1. Are you sure that the php app is setting cookies? 2. What data from the cookies are you hoping to use? 3. Is the php app on the same domain as your CF app? -- Alan Rother Manager, Phoenix Cold Fusion User Group, www.AZCFUG.org Twitter: @AlanRother

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 06:25 PM

1. It is using cookies at .fuelie.org at the path /forums 2. I just need to record the username, user id, and groupid. 3. It is on the same domain. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
06/21/2012 07:05 PM

> 1. It is using cookies at .fuelie.org at the path /forums If the cookie is set to specifically use that path, it won't be sent to any URL on your server that doesn't match that path. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Cory Fail
06/21/2012 07:48 PM

This is what I am getting in the mybb directory. Why isn't transferring over to the home? Is there something I need to do to transfer it over? Perhaps use a different forum system? CFGLOBALS    urltoken=CFID#=3654908&CFTOKEN#=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE&jsessionid#=84306bffa4d850206c356392d7a5b4c34316#lastvisit={ts '2012-06-21 21:40:03'}#timecreated={ts '2012-06-21 19:02:42'}#hitcount=30#cftoken=5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE#cfid=3654908# CFID   3654908 CFTOKEN   5d97064d9dc3543e-A21AA8C1-9C8E-9908-9B0D9102ACD5F1CE COOKIE   [empty string] JSESSIONID   8430da28351e3780595e624c2f6511829637 loginattempts   1 mybb[forumread]   a:1:{i:2;i:1340305442;} mybb[lastactive]   1340311261 mybb[lastvisit]   1340305716 mybb[threadread]   a:1:{i:1;i:1340305442;} mybbuser   1_E2luLfLB6lPUZNQtDULoR6rzb35jgW8FekA2eSPDV2cvODpaNe sid   480d6134ef92dc5f91b48815092e9279 >1. It is using cookies at .fuelie.org at the path /forums >2. I just need to record the username, user id, and groupid. >3. It is on the same domain.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
J.J. Merrick
06/22/2012 11:32 AM

I would use something like Chrome dev tools to see what cookies the browser can see and what domain they REALLY are being set on. BTW if one is forum.yourdomain.com and the other is www.yourdomain.com then the cookie will not be seen between the 2. It has to be specifically set for ".yourdomain.com" to be seen by both. J.J. On Thu, Jun 21, 2012 at 6:47 PM, Cory Fail <juturnaphoto@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

June 19, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
             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             

Designer, Developer and mobile workflow conference