2011-12-20 141 views
2

我想在超時客戶登錄會話前2分鐘顯示一條警告消息,詢問他們是否仍然存在。我將Cookie的使用時間設置爲15分鐘,因此在13分鐘後,我要提醒用戶會話超時。如何在magento中做到這一點?處理magento會話超時

如果有人提供一個清晰的想法,我會很高興。我是magento的新手。

<script type="text/javascript"> 

var t = setTimeout('areYouStillThere()', 3000); 

function areYouStillThere(){ 
    if(confirm('Session is expiring. Are you still there?')){ 
    location.reload(); 
    } 
} 

</script> 

可以改善:

回答

6

你/add/design/frontend/[your-interface]/[your-theme]/page/html/head.phtml的底部添加以下代碼它與原型或jQuery,如果你想。

+0

太好了,謝謝 – Anz 2011-12-20 10:02:54