I am new to Magento and I want to destroy the session when
- the user doesn't browse through your site for a while (5 mins) and
- the user closes the browser directly
In both cases the session should expire and redirect to login page. I Googled for this and I found that:
System->Configuration->Web->Session Cookie management->Cookie Lifetime
- If I will set this value to 300(5 mins) then the session will expire and it's fine.
- If I set the same value to '0' then it will work for second case(if browser close then session expire)
Suppose I want to expire session for above both cases then how can I get it work?