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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:06:50+00:00 2026-05-15T18:06:50+00:00

Without cookies enabled, a form post will throw ActionController::InvalidAuthenticityToken . For the most part,

  • 0

Without cookies enabled, a form post will throw ActionController::InvalidAuthenticityToken. For the most part, I just handle the exception with a message stating that cookies are required to login to my application.

However, one thing users of my application can do is create content to be shared with other people, who may or may not be logged in (it is not required). Furthermore, this content can be password protected if the creator chooses to do so. This is where I am running into problems. If it matters, I am using the active_record_store as my session_store, and also have config.action_controller.session set.

If a visitor tries to unlock password protected content without having cookies enabled, the application will throw the exception, and from the visitor’s perspective, crash. I would like to be able to handle this situation, but I am not sure how to. I could handle the exception and allow the content to be unlocked without checking the cookie, but if I am doing so I might as well not be protecting the action against CSRF because I’d be opening up a vulnerability anyways, correct? Alternately, I could require cookies to be enabled so that the form can be authenticated, but there really is no reason to otherwise require cookies in this situation.

If I understand correctly, if I disable protection on that action, I will only be exposing unlocking protected content to a CSRF vulnerability, but if cookies are not enabled anyways, would it matter? Is there a way to protect while handling a lack of cookies?

  • 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-15T18:06:50+00:00Added an answer on May 15, 2026 at 6:06 pm

    I don’t think it will be a problem to disable it for that action. Forgery protection is only really useful for actions that have some effect on your app’s data.

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

Sidebar

Related Questions

I am trying to use PHP session without using cookies. I have enabled session.use_trans_sid
Is it possible to have secure authentication without using session, cookies and SSL ?
how can I set cookies in the middle of a document, without incurring a
Is there a way to pass data between pages without using cookies and a
I am trying to find a way using jquery without cookies to display a
My application should work without cookies. How can I get the parameters of the
I am considering using a cookie-ip matching system to log in users automatically without
How to securely store usernames in database, without adding them directly to cookie value?
How to dynamically, via jQuey, delete a session cookie, without manually restarting the browser?
Without using any other jquery plugin I'm looking to continuously flash/change a div's border

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.