# Custom session key prefix for Session CacheStore

**URL:** <https://discuss.rubyonrails.org/t/custom-session-key-prefix-for-session-cachestore/71683>\
**Category:** rubyonrails-core\
**Created:** [February 22, 2016, 11:12pm UTC](https://discuss.rubyonrails.org/t/custom-session-key-prefix-for-session-cachestore/71683 "2016-02-22T23:12:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Espen\_Antonsen1](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/espen_antonsen1/32/1795_2.png) [@Espen\_Antonsen1](https://discuss.rubyonrails.org/u/Espen_Antonsen1)\
**Post date:** [February 22, 2016, 11:12pm UTC](https://discuss.rubyonrails.org/t/custom-session-key-prefix-for-session-cachestore/71683/1 "2016-02-22T23:12:52Z")

</div>

The current implementation allows no configuration and sets the cache key within a namespace: “\_session\_id:#{sid}”. The set CacheStore can use an additional namespace though.

> <https://github.com/rails/rails/blob/930110b0452bd33e0ee54e9ec6d68e904ba7a0ad/actionpack/lib/action_dispatch/middleware/session/cache_store.rb#L45>

Anyone have any input on allowing a custom key like other session stores (dalli, redis-actionpack) or is there a specific reason why it has to be namespaced “\_session\_id”?
