SlideShare une entreprise Scribd logo
1  sur  36
Things I learned writing a
Facebook Canvas App



          Carl Mercier
           @cmercier
       github.com/cmer
Painful
FACEBOOK IS TAKING
OVER THE INTERNET
A CANVAS APP
A CANVAS APP

       =

APP IN AN IFRAME
EVERY GET IS A POST
EVERY GET IS A POST

GET http://apps.facebook.com/my-app

              becomes

      POST http://myapp.com/
EVERY GET IS A POST

GET http://apps.facebook.com/my-app/foo

                becomes

     POST http://myapp.com/foo
rack-facebook-signed-request
my fork: github.com/cmer/rack-facebook-signed-request
AUTHENTICATION
WITH SIGNED_REQUEST
P3P
PRIVACY PREFERENCES PROJECT
Painful
P3P
PRIVACY PREFERENCES PROJECT
P3P
PRIVACY PREFERENCES PROJECT
rack-p3p
github.com/hoopla/rack-p3p
HOW DO I KEEP A SESSION WITHOUT COOKIES?
HOW DO I KEEP A SESSION WITHOUT COOKIES?




    YOU CAN’T

    SO YOU WORK AROUND IT.
window.top.location = "http://apps.facebook.com/my-app/foo";
AJAX EVERYTHING
 similar to PJAX http://pjax.heroku.com/
BROKEN BACK BUTTON
BROKEN BACK BUTTON
History.js                        PJAX
github.com/balupton/History.js    github.com/defunkt/jquery-pjax


• Very    extensive               • Very   simple to implement

• Fixes   many browser bugs       • Notmuch control on what
                                   happens
• Complex     to implement
                                  • No   support for IE
• Supports    IE with hash-bang
 urls

• Continuously    improved
Rolled out my own based on History.js but
          with a PJAX feel to it.




     CJAX
Source at gist.github.com/2008643
Beware of console.log
 Source at gist.github.com/2008671
fb-canvas-rails
             github.com/cmer/fb-canvas-rails




         All the concepts from this presentation
                 bundled in a demo app!

See it in action at http://apps.facebook.com/fb-canvas-rails
socialization
  github.com/cmer/socialization


Follow, Like and Mention in a Gem
Thanks!

Carl Mercier
  c@cmer.me
  @cmercier

Contenu connexe

Dernier

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Dernier (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

En vedette

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

En vedette (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Things I learned writing a Facebook Canvas App

Notes de l'éditeur

  1. - My name is Carl\n- Prog for 25 years :(\n- Defensio, security suite for the social web\n- first time in a long time i don’t talk about D\n- Working on a new project\n - FB app\n - Social Craigslist on Facebook\n - People interact and communicate around items for sale\n - Not ready to disclose more\n - Still testing a bunch of things before I call this a startup\n\n- While Defensio Defensio\n - Facebook app for protecting pages\n - Little exposure to the FB API\n - Just heard about it mostly\n\n- Been working on this new project for ~3 months\n- And one thing I found is that working with...\n
  2. with Facebook API\n\n
  3. IS A PAIN IN THE ASS\n- API constantly changes\n- API is slow\n- API breaks\n- API is buggy and they don’t care\n- etc\n\n
  4. - However, the fact is that INTERNET LIFE IS FACEBOOK\n\n- 10 years ago, going on the Internet meant the blue E\n- Now it’s FB\n\n
  5. The truth is\n- Most people visit few other websites \n- Spend hours/day on FB, more than on any other sites.\n- Probably more than every other sites combined\n- How people use it:\n - Photo sharing\n - Email\n - Chat\n - Romance\n - Bragging\n - Stalking\n\n- See why FB is very powerful\n\n- Dave McClure says that for a product to be successful, it has to: Make you famous, Get you laid or Make you rich\n - Facebook is all 3\n - Famous: bragging, showing off, self publicity\n - Laid: people hook on (and break up) on FB all the time\n - Rich: FB is the perfect medium for businesses to engage with their customers\n\n- I don’t know of any other platform that can do all 3 so well.\n- Anybody here ever got laid on Twitter? Yeah. I rest my case.\n\n- That’s why having your web presence inside of Facebook or at least well integrating with FB makes sense.\n - everybody’s there\n - Ppl don’t want to leave Facebook\n - Free eyeballs and traffic\n \nBut it’s a pain in the ass.\n\n\n
  6. The project I’m working on is a CANVAS APP\n\nJust an iFrame\n\nThis is the biggest problem I’ve encountered, causing most of the issues\n\nBrowsers react differently\n\nVery few social interaction so far\n\n\n
  7. - FB does this for security reasons, mainly to remove the http-referrer header\n- Very problematic for RESTful apps\n- Rails: HTTP verbs are meaningful\n- How many familiar with Rails?\n\n- Path will be useful later\n\n\n- Might be tempted to resort to all kinds of hacks\n- Solution is pretty simple.\n
  8. - FB does this for security reasons, mainly to remove the http-referrer header\n- Very problematic for RESTful apps\n- Rails: HTTP verbs are meaningful\n- How many familiar with Rails?\n\n- Path will be useful later\n\n\n- Might be tempted to resort to all kinds of hacks\n- Solution is pretty simple.\n
  9. - FB does this for security reasons, mainly to remove the http-referrer header\n- Very problematic for RESTful apps\n- Rails: HTTP verbs are meaningful\n- How many familiar with Rails?\n\n- Path will be useful later\n\n\n- Might be tempted to resort to all kinds of hacks\n- Solution is pretty simple.\n
  10. - Ruby Gem\n- Takes POSTs and convert them to GETs for Rails\n- Also useful for authentication\n\n- My fork\n\n
  11. - GEM also useful for\n - simplifying authentication\n - injecting facebook scripts\n
  12. - When FB post to our app, a signed JSON data structure is sent to our app\n- every single time\n- This info contains info about authenticated user (on FB, and/or with your app)\n\n- but not if our links don’t have target = _top\n- url in url bar never changes\n\n\n
  13. GEM CODE\n\nrack-facebook-signed-request gem exposes the signed_request to our Rails app\n\n- original in facebook.signed_request\n- decrypted in facebook.params\n\n
  14. Explain code\n\n- facebook.params is a hash containing\n - fb uid\n - oauth_token\n - user full name\n - etc depending on permissions given by user\n\n- original in facebook.signed_request\n\nAlso use OmniAuth for FB permissions\n\n
  15. - Can’t rely on cookies in iFrames\n--- click troll ----\n- Mostly on IE. Third-party cookies DISABLED for most users\n - Explain 3rd party cookies\n\n- Doesn’t seem to be the default, so don’t know why\n\n- Impossible to keep a client-based session open\n- Authentication becomes painful\n\n
  16. - Another reason for no cookie in iframe: P3P\n- Again, IE\n\n
  17. One of those things that will take you days to figure out if you’re not familiar with it\n\n
  18. *autotroll*\n\n- Explain P3P (header, privacy related)\n- This is the thing Google and Facebook got in “trouble” for recently.\n- P3P such a stupid broken security mechanism that I personally have NO problem working around it. like most people do.\n\n- After writing a canvas app, you’ll hate IE at least 576% more. guaranteed.\n\n
  19. - Sets the P3P header for every requests\n- Removes it on 304 Not Modified, and remove cookies\n\n- Used it for Defensio for a few years and it worked pretty well\n\n\n
  20. - I do keep a session to make things easier when cookies are enabled\n\n\n\n\n\n---------- NO -----------\n- But when not I do:\n - redirect to apps.facebook.com/my-app \n - session in javascript variable\n \n
  21. - I do keep a session to make things easier when cookies are enabled\n\n\n\n\n\n---------- NO -----------\n- But when not I do:\n - redirect to apps.facebook.com/my-app \n - session in javascript variable\n \n
  22. - When no session and need to figure out who the user is\n\n- Redirecting to the iframe will cause Facebook to POST a signed request to our app\n\n- Very slow\n - reloads the iframe every time\n\n- The workaround for the workaround is to\n
  23. Similar to PJAX (github)\n\n- Explain PJAX\n\nAjax requests won’t send session cookie if cookies are not enabled\n
  24. The biggest hack in the history of mankind\n\nEncrypted session in javascript hash\n\nJust like Rails does CookieStore, but instead of passing the session around in a cookie, we pass it around with Javascript\n\nWhen a page loads, it has its cookie data in the <head> of the page\n\nThis is transparent for the server-side\n\n
  25. The biggest hack in the history of mankind\n\nEncrypted session in javascript hash\n\nJust like Rails does CookieStore, but instead of passing the session around in a cookie, we pass it around with Javascript\n\nWhen a page loads, it has its cookie data in the <head> of the page\n\nThis is transparent for the server-side\n\n
  26. - one of the most annoying problems\n- back button always goes back to previous page on FB\n- only way around that. AJAX! Use PushState\n- Explain pushstate\n- click troll --- Not supported in IE\n\n\n
  27. - one of the most annoying problems\n- back button always goes back to previous page on FB\n- only way around that. AJAX! Use PushState\n- Explain pushstate\n- click troll --- Not supported in IE\n\n\n
  28. \n
  29. CJAX, as in Carl JAX :)\n\n- History.js and hash-bang urls are very broken in iframes and IE\n- Can’t really rely on that.\n- On IE, each CJAX link actually in window.top.location \n- Slower but works. Punishment for using a crappy browser.\n\n- To make this work, just add the .cjax class on A tags\n\n\n\n
  30. - haven’t done much frontend development in the last few years\n- bug bite me in the ass\n- ie fails when developer toolbar is not open\n\n
  31. DEMO\n
  32. \n
  33. firefox 11\n