Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7085055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:22:39+00:00 2026-05-28T07:22:39+00:00

I trying to send a remote form to a different subdomain (example.domain.com) from the

  • 0

I trying to send a remote form to a different subdomain (example.domain.com) from the one of the form (domain.com), but i keep getting the warn WARNING: Can't verify CSRF token authenticity in the log, and inspector in chrome tells me that the status of the request is (canceled), with the type application/x-www-form-urlencoded.

This is the form:
button_to "Follow", follow_users_url(subdomain: post.user_username_slug), remote: true

When i remove the remote: true, i got the result i was hopping for. Also, when a try to use the same form in the same subdomain of the action (example.domain.com), i got the correct result.

I found a way to share the cookies in all subdomains (domain: :all in session_store.rb), but i can’t found a way to share the token in Ajax requests.

I’m using Rails 3.1.3, Ruby 1.9.3 and jQuery 1.7.1.

Anyone can help me, please?

Edit:

The problem seems to related to CORS. Now i’m trying to find a minimum friction solution to make this (Asynchronous) cross subdomains requests work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:22:40+00:00Added an answer on May 28, 2026 at 7:22 am

    In your POST paramaters, include the field “authenticity_token” with the value returned by the helper *form_authenticity_token*. (It has nothing to do with cookies).

    Edit I think you’re hitting up against the Same-Origin Policy, which prevents javascript from domain A from communicating with domain B (also applies to subdomains). There is an “override” for this called CORS, which the domain you are talking to must implement.

    So assuming you have control over both domain A and B, you can work around this limitation. This explains why “normal” requests work while “:remote => true” requests don’t. (The CSRF token error is probably inaccurate.) Here’s an article about setting up CORS in Rails (domain B, in my example).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send an email from a site I am building, but
I'm trying to send data from a form to an external script prior to
I'm trying to send an email in Java but when I read the body
I am trying to send some data from a LINQ query in C# to
Im trying to build a simple AJAX script that uses a form to send
I am trying to send growl notifications from PHP. The receiving computer is OSX
I'm trying to do java mail and im getting an error Cant send command
i'm trying to serialize a form by the id but it won't serialize and
I am trying to fill in a form using Javascript/ajax/php but the problem is
I am trying to connect to a remote MySql server from my local machine.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.