[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
A memorandum when you want to see the data acquired by Jena & SPARQL for each variable.
[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
[Rails] How to write when making a subquery
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
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
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]
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
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?
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
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 ...
How to write when you want to keep line breaks and output while avoiding XSS in Rails
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
A cheat sheet for Java experienced people to learn Ruby (rails)
ProxyFactory is convenient when you want to test AOP in Spring!
I want to add a browsing function with ruby on rails
Only this I want to remember, 4 designs for writing unit tests
Three Controller anti-patterns that we want to convey to Rails beginners to intermediates
Remedy for "A server is already running." Error when running rails s
I get a Ruby version error when I try to start Rails.
Naming convention when creating a new controller or model with rails
What to do when you become a Problem During Content Assist
When you have introduced devise but want to add more columns
kotlin & Java: How to hide the toolbar only for specific fragments
What to do when you run into a docker-compose node_modules problem