Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Cross-Domain Sessions with Ruby on Rails
Search
Lukas Fittl
January 09, 2014
Programming
1
430
Cross-Domain Sessions with Ruby on Rails
So, how does one write a Rails 4 session store?
Lukas Fittl
January 09, 2014
Tweet
Share
More Decks by Lukas Fittl
See All by Lukas Fittl
How to Scale Postgres - Automation, Tuning & Sharding
lfittl
0
480
What's Missing for Postgres Monitoring
lfittl
0
150
A Map For Monitoring PostgreSQL
lfittl
2
340
Monitoring Postgres at Scale
lfittl
1
320
Monitoring PostgreSQL at Scale
lfittl
4
220
Postgres Performance for App Developers
lfittl
2
220
GraphQL ❤ PostgreSQL -- P.S. aka BeatQL
lfittl
1
500
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
410
PostgreSQL at a Web Startup
lfittl
3
550
Other Decks in Programming
See All in Programming
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
1
120
もうすぐ新年度、Babylon.jsがお勧めな3個の理由
hideg
0
160
The Future of C++ Interoperability: Insights from Porting a Game to Swift
teamhimeh
0
270
自動テスト実行結果の目的を整理する / Organizing objectives of automated test results
twada
PRO
10
2.1k
WinUI 3デモ - "CommunityToolkit.Mvvm"NuGetパッケージ編
andrewkeepcoding
0
130
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.2k
Learning PHP and Static Analysis with PHP Parser
inouehi
1
250
クソコード動画『カプセル化 Mk-II』 で考える 上手くカプセル化できない理由 / encapsulation2
minodriven
11
7.8k
Data Contracts In Practice With Debezium and Apache Flink (Kafka Summit London)
gunnarmorling
2
280
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
[スクリプト] Swiftの型推論を学ぼう
omochi
0
110
document.write再考
brn
5
2.5k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
113
18k
Imperfection Machines: The Place of Print at Facebook
scottboms
257
12k
Design by the Numbers
sachag
274
18k
Optimizing for Happiness
mojombo
369
69k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Gamification - CAS2011
davidbonilla
76
4.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
18
1.7k
Web development in the modern age
philhawksworth
201
10k
Typedesign – Prime Four
hannesfritz
36
2k
Embracing the Ebb and Flow
colly
78
4.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
242
12k
Transcript
@LukasFittl Cross-Domain Sessions So, how does one write a Rails
4 session store?
Biz + UX + Dev @LukasFittl
So, 7 years ago we started this company: commit 2086c55b13426c2834f7060ad3739eed68e891c2
Author: Esad Hajdarevic <
[email protected]
> Date: Sun Mar 25 22:47:30 2007 +0000 ! Initial tags+trunk creation git-svn-id: svn://svn.phoria.eu/soup/trunk@1 c0834aa2-9929-0410-9117-c50b2a7daf23
Its still around :) ! But it runs Rails 2.3.
100+ hours later we’re (almost) on Rails 4.
Soooo... Sessions.
www.soup.io = Login/Logout/etc
mysoup.io = Soup Admin, Create Posts, etc
How can we make that work?
First thought: <iframe>
Actually, thats pretty painful.
What we ended up doing: www.soup.io mysoup.io Memcached / Redis
SESSION_ID REMOTE_SESSION_ID
Getting a REMOTE_SESSION_ID: http://mysoup.io/ => http://soup.io/remote/generate?host=mysoup.io (requested with main session
cookie YYY) ! => http://mysoup.io/?sessid=ZZZ SetCookie: soup_session_id=ZZZ ! => http://mysoup.io/ ! remote_session_link_ZZZ => mysoup.io--YYY Memcached / Redis
Lets look at the code :)
@LukasFittl Thank you! pganalyze.com