What is the best approach of removing cross domain cookies from one of the apps?
-
I've set 2 applications. Rails application and Rack one (Grape). I also configured the cookies so it'll be shared cross them. The Rails application is the a client application and the Rack one is for api. In the Rails app I set devise for authentication and in the api the application get authenticated via auth_token passed to the cookies. The problem is: I want to set a call in the api that would be able to remove and destroy the cookies in the api so it'll remove them in the app and the user session will be destroyed (sign out). I tried this by removing the cookies in the api by 'Chrome console' and I saw that the app signed out after it. please note that the cookies the Rails app set are 2: `_xxx_session` and `auth_token` and both are http only. How to remove the cookies from the api via Ruby? And will it be removed from the Rails app?
-
Answer:
A simple way to remove cookies is to send the set-cookie response header with an expires date in the past. This way, you overwrite the name of the cookie for your sessions with an expires date in the past. Any subsequent requests made by the browser will not contain the expired cookie.
Tj Krusinski at Quora Visit the source
Related Q & A:
- What are the best iTunes apps?Best solution by Ask.com old
- What are the best apps for the iPod touch?Best solution by Yahoo! Answers
- What are the best apps for iPod Touch?Best solution by Yahoo! Answers
- What are the best apps for Blackberry Curve?Best solution by Yahoo! Answers
- What is the best approach for me to get a job?Best solution by techrepublic.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.