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 7673515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:31:45+00:00 2026-05-31T16:31:45+00:00

We are designing an application that will use Rails and WordPress to interact with

  • 0

We are designing an application that will use Rails and WordPress to interact with each other. We would like to have a universal logout where you could logout from either application and it would delete cookies from the other app. They will share the same host and toplevel domain. Is there a way to do this?

  • 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-31T16:31:47+00:00Added an answer on May 31, 2026 at 4:31 pm

    Access to a cookie is dependent on the domain of the server attempting to read the request — and potentially the domain specified in the cookie. So assuming the domains match (e.g. http://www.example.com and http://www.example.com on both blog and Rails app) either should have access to a cookie set by the other.

    If this is not the case (e.g. blog.example.com, http://www.example.com), you’ll need to make sure when the cookie is set in either place, it’s set for the entire domain (e.g. .example.com). But this doesn’t help: while Rails can delete WP’s cookie, and vice-versa, the method for creating (and using) them needs to be mutually understood.

    So there’s a twist here, since this is a session cookie; in this case, the cookie (which either app should have access to) is setting a value that is used and interpreted on the server side, where sessions are managed. WordPress and Rails both different methods and look for different cookies.

    A solution (idea) would be to have one or the other subsystem catch incoming requests (most likely WP, and probably through some .htaccess RewriteRule, assuming you’re using Apache) and create an intermediate cookie that the other could check that provides sufficient proof that the user has logged in correctly. WP’s PHP for this is pretty good, and easily extended — you just need to create some token that’s a shared secret between the two apps (one of the values in wp-config.php such as LOGGED_IN_KEY might be a good option).

    Maybe a solution would be to take the publicly available value from the WP cookie for username, and append the shared secret value and (in both systems) create an MD5 hash to store in a cookie. In this case, Rails’ authentication would subordinate to WP’s, so you would need to make sure Rails knew to delegate things like forgotten password, changed password, etc, to WP’s mechanisms.

    Obviously I am thinking aloud, but maybe this is a path to consider.

    In any case, this is preferable to having both systems know how to trust the other’s authentication.

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

Sidebar

Related Questions

I'm designing an application that will use Oracle , and we have this department
I'm designing a WPF program that will use a DLL-plugin architecture. The host application
Let's say that I'm currently designing an application where I will need to use
I have a Ruby on Rails application that will be a CMS in way
Building a rails B2B application that will have various users. I'm pretty clear on
I am designing a test application (Using NUnit) that will have to navigate (through
I am designing an internal web application that will have 3 layers: Presentation (MVC)
I'm designing an application that will allow me to draw some functions on a
The application that I'm designing will retrieve and store content from a variety of
I am presently designing a database schema for use in a Rails 3.1 application.

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.