# How to prevent sessions from being flushed to disk?

**URL:** <https://www.ruby-forum.com/t/how-to-prevent-sessions-from-being-flushed-to-disk/118051>\
**Category:** Rails\
**Created:** [October 23, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/how-to-prevent-sessions-from-being-flushed-to-disk/118051 "2007-10-23T16:34:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 23, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/how-to-prevent-sessions-from-being-flushed-to-disk/118051/1 "2007-10-23T16:34:00Z")

</div>

Hi,

We have an ajax process that is sending multiple requests  
asynchronously to some  
controller actions. These actions need to read the session, but we  
don’t want  
the session to be flushed back to disk when the action completes.

The reason this capability is needed is that there may be multiple  
requests in-flight  
from a single browser (either with or without browser tabs open).  
These multiple  
concurrent requests can cause inconsistencies in the session, when run  
with a  
parallel/fastcgi web server.

How can we tell Rails not to flush a session back to disk when the  
action finishes?

Thanks,

David
