DEV Community

Discussion on: Have you ever felt completely helpless when facing down a coding problem?

Collapse
 
yaser profile image
Yaser Al-Najjar

No, 10x engineers never feel helpless 😂

Collapse
 
yaser profile image
Yaser Al-Najjar • Edited

Just kidding...

I had once to deal with cross domains cookies sharing.

The idea was signing in multiple subdomain names at the same time (without asking the user to click signin button everytime).

I felt so depressed for a whole weak; I tried tons of solutions... Nothing worked!

A whole weak till I wrote a middleware to share cookies across multiple subdomains... It worked perfectly 💪

Tho I'm never touching that code, EVER!

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
yaser profile image
Yaser Al-Najjar • Edited

Here is the middleware:

github.com/coretabs/dorm-portal/bl...

Right before serving any request, it writes the same sessionid with CSRF token across multiple domains (pre-defined in an env var), so that you get logged-in once and for all.

  • We have multiple subdomains for this app, like: DOMAIN.com, admin.DOMAIN.com, api.DOMAIN.com
Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
yaser profile image
Yaser Al-Najjar • Edited

Yep subdomains (been edited, thx)... and no, it won't be enough 😁

I don't remember what was the problem I ran into after using the main domain trick (adding a dot).

Collapse
 
localhost4484 profile image
Ohm

What is "10x engineers"? I heard it a little. Is that kind of trends?

Collapse
 
lbayliss profile image
Luke Bayliss • Edited

An engineer that is 10 times better or more productive than your normal engineer. A unicorn. A rock-star dev. A ninja.

Thread Thread
 
prateek_gogia profile image
Prateek Gogia

More like a Ninja?

Thread Thread
 
lbayliss profile image
Luke Bayliss

Fixed it.