title: Validating CSRF token generated by rails in express app
body: <p>My app uses rails for the frontend and is an express app on the backend. Is there a way to validate the csrf token generated by rails in an express app?</p>
  
  <p>I've gone through the way in which rails generates the CSRF token and validates it. It stores the real csrf token which is a base64 encoded random hex in session cookie. Post that, it applies a bunch of encryptions including padding some bytes before the encrypted token. The session is encrypted with secret key base. </p>
  
  <p>Intially I thought of getting the real csrf token from session cookie and apply the similar encryption done by rails to validate the token. But this seems to be a tedious task since the session is encrypted with secret key base and express needs to decrypt the detail in session somehow. </p>
  
  <p>Has anyone tried this kind of setup? Any help will be appreciated.</p>