# Disable session cookie during a request

**URL:** <https://www.ruby-forum.com/t/disable-session-cookie-during-a-request/172012>\
**Category:** Rails\
**Created:** [July 13, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/disable-session-cookie-during-a-request/172012 "2009-07-13T12:27:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [July 13, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/disable-session-cookie-during-a-request/172012/1 "2009-07-13T12:27:27Z")

</div>

My code makes extensive use of sessions for things like the logged in  
user. I have added a stateless API that authenticates on each  
request, but it uses underlying code that sets session data. In the  
stateless case, the session is populated on each request. I don’t  
want it persisted.

Is there a way to prevent the session cookie from being set, or do I  
need to go through and find all of the instances where the session is  
accessed?
