# Session expire

**URL:** <https://www.ruby-forum.com/t/session-expire/104673>\
**Category:** Rails\
**Created:** [May 21, 2007, 1:28pm UTC](https://www.ruby-forum.com/t/session-expire/104673 "2007-05-21T13:28:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [May 21, 2007, 1:28pm UTC](https://www.ruby-forum.com/t/session-expire/104673/1 "2007-05-21T13:28:28Z")

</div>

Hello

I want the code to expire the session when i close the browser.

is it possible to call an action from a controller from java script?

If not then wat code can be written to expire session when the user  
closes the browser window.

Pls reply

thanks

dhaval
