处理magento会话超时

时间:2011-12-20 08:43:48

标签: magento magento-1.4

我希望在超时客户登录会话前2分钟显示一条警告消息,询问他们是否仍在那里。我将cookie的生命周期设置为15分钟,因此在13分钟后,我想警告用户会话超时。如何在magento中做到这一点?

如果有人提出明确的想法,我会很高兴。我是magento的新手。

1 个答案:

答案 0 :(得分:6)

在/ add / design / frontend / [your-interface] / [your-theme] /page/html/head.phtml底部添加以下代码:

<script type="text/javascript">

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

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

</script>

如果需要,可以使用prototype或jQuery来改进它。

相关问题