• PHP 读取session和往session写内容


    
        请求信息 : 2017-05-11 19:36:04 HTTP/1.1 GET : /DEVOPS/index.php/Main/index
        运行时间 : 0.0297s ( Load:0.0048s Init:0.0110s Exec:0.0004s Template:0.0134s )
        内存开销 : 2,012.68 kb
        查询信息 : 0 queries 0 writes
        文件加载 : 33
        缓存信息 : 0 gets 0 writes
        配置加载 : 138
        会话信息 : SESSION_ID=lsnqn8pks7hl9qet2she86pke5
    
    node2:/var/www/html/DEVOPS/Home/Lib/Action#vim IndexAction.class.php
    
    <?php
     class IndexAction extends Action {
             function index(){
                     $this->display();
             }
    
            function do_login(){
                    //获取用户名和密码信息,和数据库中比对
                     echo 111111111;
                     dump($_POST);
                     echo 222222222;
                     dump($_SESSION);
                     echo 33333333;
    
                    $username=$_POST['username'];
                    $password=$_POST['password'];
                    $code=$_POST['code'];
                     echo md5($code);
    	
    
    	
    	111111111
    
    array(3) {
      ["username"] => string(5) "admin"
      ["password"] => string(5) "admin"
      ["code"] => string(4) "5653"
    }
    
    222222222
    
    array(3) {
      ["verify"] => string(32) "d7e4cdde82a894b8f633e6d61a01ef15"
      ["username"] => string(5) "admin"
      ["authority"] => string(1) "1"
    }
    
    33333333d7e4cdde82a894b8f633e6d61a01ef15
    
    往SESSION写东西:
    
    <?php
     class IndexAction extends Action {
             function index(){
                     $this->display();
             }
    
            function do_login(){
                    //获取用户名和密码信息,和数据库中比对
                     $_SESSION['aaa']='ssada1';
                     echo 111111111;
                     dump($_POST);
                     echo 222222222;
                     dump($_SESSION);
                     echo 33333333;
    
    
    
    111111111
    
    array(3) {
      ["username"] => string(5) "admin"
      ["password"] => string(5) "admin"
      ["code"] => string(4) "7334"
    }
    
    222222222
    
    array(4) {
      ["verify"] => string(32) "7fcb0a2c0f0f41d9f4454ac2d8ed7ad6"
      ["username"] => string(5) "admin"
      ["authority"] => string(1) "1"
      ["aaa"] => string(6) "ssada1"
    }
    
    333333337fcb0a2c0f0f41d9f4454ac2d8ed7ad6

  • 相关阅读:
    python并发编程之多进程
    python并发编程之多进程理论部分
    Python GIL(Global Interpreter Lock)
    python并发编程之多线程
    前端基础之CSS
    前端知识之HTML内容
    Python杂货铺-(1)os模块在python中执行shell命令
    Hive学习小记-(17)inline(array(struct))与explode
    Hive学习小记-(16)hive加载解析json文件
    Hive学习小记-(15)transform函数
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349732.html
Copyright © 2020-2023  润新知