dedecms织梦模板模拟会员登录和退出代码

织梦技巧评论326 views阅读模式

首先模拟会员登录和退出,有两个重要文件,一个是include下的memberlogin.class.php和include/helpers下的cache.helper.php文件。

原理为:memberlogin.class.php通过使用缓存助手 helper('cache'),然后/member/config.php 文件引入memberlogin.class.php文件实现模拟登录和退出。

模拟会员登录代码

 

引入/member/config.php

 

$cfg_ml->DelCache($cfg_ml->M_ID);//清除会员登录缓存

$cfg_ml->PutLoginInfo($mid);//让某用户登录

 

模拟会员退出代码

 

引入/member/config.php

 

查看源码打印代码帮助

$cfg_ml->DelCache($cfg_ml->M_ID);//清除会员登录缓存

$cfg_ml->ExitCookie();//退出当前登录用户

企鹅博客
  • 本文由 发表于 2020年8月11日 17:51:55
  • 转载请务必保留本文链接:https://www.qieseo.com/35156.html

发表评论