dongyingtang3803
2017-06-28 15:18
浏览 51
已采纳

Get方法中未定义的会话变量

Hi i'm trying to get the value in session in my get method,actually value is there but its throwing an error that undefined $_SESSION variable as i'm returning value in this get method,so code is not executing furher.Please help1

<?php

class Session {

    public static function init() {
        session_start();
    }

    public static function set($key, $value) {
        $_SESSION[$key] = $value;
    }

    public static function get($key) {
        return $_SESSSION[$key];
    }

    public static function destroy() {
        //unset($_SESSION);
        session_destroy();
    }

}?>
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题