I want to know how user send request from third party using ajax and set cookie into controller in ror

I want to know how user send request from third party using ajax and set cookie into controller in ror