https://avo.cool logo
Rails API with secure cookie
# general
n
hey guys, I have a rails question if anyone ever worked on it: have you ever built something like this: - rails api with secure cookie - react / nextjs / vuejs frontend reading the cookie that was set in rails to verify user's session ?
l
Hi Roc, I haven't
are you hitting any specific issue?
n
yes, the cookie is not being set in SSR
only CSR
Copy code
ruby
    cookies.encrypted[:user_id] = {
      value: current_user.id,
      same_site: :none,
      httponly: true,
      secure: Rails.env.production?
    }
l
No idea, have you tried to ask an AI agent?
n
yes... all of them have the same useless answer 😂
l
me either 😛
at least not without using a template or having everything set up for me
but if I were you I would discuss this with claude/cursor and nail it down
they should know about these things