|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Grabbing PHP cookies
<cfoutput>#COOKIE.name_of_cookie#</cfoutput>Edward Chanter 06/21/12 10:43 A Cookies are per domain - so you just... use em. If you have yourRaymond Camden 06/21/12 10:43 A > 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. MyDave Watts 06/21/12 10:49 A > > I'm still some what a beginner with CF so take it easy on me. ICory Fail 06/21/12 02:11 P >> > I'm still some what a beginner with CF so take it easy on me. ICory Fail 06/21/12 02:15 P One of the greatest tools in ColdFusion is the CFDUMP tag.Jordan Michaels 06/21/12 02:37 P > One of the greatest tools in ColdFusion is the CFDUMP tag.Cory Fail 06/21/12 02:51 P > One of the greatest tools in ColdFusion is the CFDUMP tag.Cory Fail 06/21/12 02:51 P Sorry for the double posts.. It didnt seem like it was sent.Cory Fail 06/21/12 02:54 P Looking at your dump, those are pretty much all ColdFusion created cookies.Alan Rother 06/21/12 05:46 P 1. It is using cookies at .fuelie.org at the path /forumsCory Fail 06/21/12 06:25 P > 1. It is using cookies at .fuelie.org at the path /forumsDave Watts 06/21/12 07:05 P 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?Cory Fail 06/21/12 07:48 P I would use something like Chrome dev tools to see what cookies theJ.J. Merrick 06/22/12 11:32 A 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! <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 ----- 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 ----- > 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. >> > 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! 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! 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! > 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. > 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 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 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 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 ----- > 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. 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. 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 -----
|
June 19, 2013
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||