[RUBY] When you want Rails to disable a session for a specific controller only

Overview

There are times when you want to disable cookie sessions for certain controllers only.

For example, in management screen A, session management is performed with active_record_store. In management screen B, for example, when session management is performed with devise token auth.

In this case, I want session management to work only on management screen A, but on management screen B also with active_record_store The session data will be written to the sessions table.

Countermeasures

It is OK if you describe the following process on the controller for which you want to disable the session.

request.session_options[:skip] = true

reference https://stackoverflow.com/questions/33318060/how-do-i-prevent-rails-from-creating-a-session

Recommended Posts

When you want Rails to disable a session for a specific controller only
I want to recursively search for files under a specific directory
A memorandum when you want to see the data acquired by Jena & SPARQL for each variable.
When you want to check whether the contents of a property can be converted to a specific type
[Rails] Use validation on a specific controller
Basic Rails commands you want to learn
A memo when you want to clear the time part of the calendar
When you want to add a string type column with a limited length with the `rails generate migration` command
What to do when you want to delete a migration file that is "NO FILE"
When you want to bind InputStream in JDBI3
A note when you want Tuple in Java
When you want to use the method outside
[For beginners] Procedure for creating a controller using rails
[Ruby] When you want to replace multiple characters
[rails] After option useful when you want to change the order of DB columns
You don't have to write for twice when you make a right triangle in Java
Code to use when you want to process Json with only standard library in Java
[Rails] How to create a signed URL for CloudFront
Things to watch out for when creating a framework
I want to use a little icon in Rails
I want to monitor a specific file with WatchService
I want to apply ContainerRelativeShape only to specific corners [SwiftUI]
What to do when rails creates a 〇〇 2.rb file
An introductory book to read when you start Rails
I want to define a function in Rails Console
When you want to dynamically replace Annotation in Java8
[Rails] How to load JavaScript in a specific view
[IOS] To allow rotation of only a specific screen
A memo to check when you try to use Lombok
I want to create a generic annotation for a type
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
[Ruby + Rails] When you want to register in Mailchimp's mail list together with user registration
When you want to change the wording to be displayed when making a select box from enum
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do if you get a "302" error in your controller unit test code in Rails
Tutorial to create a blog with Rails for beginners Part 1
What to do when you launch an application with rails
Session was a cookie designed to be erased when the browser was closed and was a method for exchanging it: Rails Tutorial Note-What is a Rails Session?
Solution for errors that occur when upgrading to Rails 5.2 series
I want to make a specific model of ActiveRecord ReadOnly
I want to create a form to select the [Rails] category
When you want to explicitly write OR or AND with ransack
Tutorial to create a blog with Rails for beginners Part 2
When you want to change the MySQL password of docker-compose
Apply CSS to a specific View in Ruby on Rails
docker-compose.yml when you want to keep mysql running with docker
[ruby] Creating a program that responds only to specific conditions
Measures for taking a long time to load images (Rails)
lombok.config when you want to pass @Qualifier to @RequiredArgsConstructor with lombok
Delegate is convenient to use when you want to reuse parts
Tutorial to create a blog with Rails for beginners Part 0
[Swift] When you want to know if the number of characters in a String matches a certain number ...
[Controller] I want to retrieve the numerical value of a specific column from the DB (my memo)
Object-oriented design that can be used when you want to return a response in form format
If you want to mock a method in RSpec, you should use the allow method for mock and the singleton method.
A trick when you want to insert a lot of line breaks and tabs when substituting a character string
[Rails] How to disable turbolinks
[Rails / Routing] How to refer to the controller in the directory you created
I want to create a chat screen for the Swift chat app!
A cheat sheet for Java experienced people to learn Ruby (rails)
ProxyFactory is convenient when you want to test AOP in Spring!