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
460
1
Share
Cross-Domain Sessions with Ruby on Rails
So, how does one write a Rails 4 session store?
Lukas Fittl
January 09, 2014
More Decks by Lukas Fittl
See All by Lukas Fittl
How to Scale Postgres - Automation, Tuning & Sharding
lfittl
0
690
What's Missing for Postgres Monitoring
lfittl
0
280
A Map For Monitoring PostgreSQL
lfittl
2
410
Monitoring Postgres at Scale
lfittl
1
490
Monitoring PostgreSQL at Scale
lfittl
4
280
Postgres Performance for App Developers
lfittl
2
330
GraphQL ❤ PostgreSQL -- P.S. aka BeatQL
lfittl
1
650
Hacking PostgreSQL to Gain SQL Parsing Superpowers
lfittl
1
630
PostgreSQL at a Web Startup
lfittl
3
620
Other Decks in Programming
See All in Programming
Claspは野良GASの夢をみるか
takter00
0
130
AIエージェントの隔離技術の徹底比較
kawayu
0
440
分析エージェント精度向上における データアナリストの役割
oura_shoya
0
130
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
240
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
220
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
260
誰も頼んでない機能を出荷した話
zekutax
0
140
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
360
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
10
2.8k
Moments When Things Go Wrong
aurimas
3
120
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
1.1k
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
270
Featured
See All Featured
Music & Morning Musume
bryan
47
7.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
230
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
340
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.2k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
How to Ace a Technical Interview
jacobian
281
24k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
From π to Pie charts
rasagy
0
190
Paper Plane (Part 1)
katiecoart
PRO
0
7.9k
Product Roadmaps are Hard
iamctodd
PRO
55
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