common下部分代码:
namespace app\common\controller;
use think\Controller;
use think\Request;
use think\Validate;
use think\facade\Validate as Validates;
use think\Db;
use think\Session;
class Common extends Controller
{
public function check_code($username,$code){
/* 检测是否超时*/
$last_time = Session($username.'_last_send_time');
dump(session($last_time);die;
}code下部分代码如下:namespace app\code\controller;
use app\common\controller\Common;
use think\Request;
use think\Session;
use phpmailer\PHPMailer;
use Sms\SmsMultiSender;
use Sms\SmsSenderUtil;
use Sms\SmsSingleSender;
class Code extends Common
{
session($username.'_last_send_time',time());
}code下能打印出 session($username.'_last_send_time');但是在common模块下获取session($username.'_last_send_time')为NULL。
有大神指点下,我哪里弄错了?
最佳答案