# How to reset session if rails server is killed abruptly using Ctrl-c

**URL:** <https://www.ruby-forum.com/t/how-to-reset-session-if-rails-server-is-killed-abruptly-using-ctrl-c/164812>\
**Category:** Rails\
**Created:** [April 6, 2009, 9:34am UTC](https://www.ruby-forum.com/t/how-to-reset-session-if-rails-server-is-killed-abruptly-using-ctrl-c/164812 "2009-04-06T09:34:34Z")\
**Posts on this page:** 2\
**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:** [April 6, 2009, 9:34am UTC](https://www.ruby-forum.com/t/how-to-reset-session-if-rails-server-is-killed-abruptly-using-ctrl-c/164812/1 "2009-04-06T09:34:34Z")

</div>

Hi,

I have some user informations stored in the session.  
If i use Ctrl-c to kill the rails server and restart the server, the  
informations remains in the session  
I want the session informations gone, once i restart the server  
Any suggestions?

Regards,  
Vimal Das

---

<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:** [April 6, 2009, 9:50am UTC](https://www.ruby-forum.com/t/how-to-reset-session-if-rails-server-is-killed-abruptly-using-ctrl-c/164812/2 "2009-04-06T09:50:23Z")

</div>

On Apr 6, 8:33 am, vimal [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I have some user informations stored in the session.  
> If i use Ctrl-c to kill the rails server and restart the server, the  
> informations remains in the session  
> I want the session informations gone, once i restart the server  
> Any suggestions?

If you are using the cookie store the user session is stored on the  
user’s computer, so the only thing you can do is change the session  
secret. With the other stores it depends on the stores, eg if you use  
the database store then delete the rows in the sessions table.

Fred
