php - __construct function not working -


Public function __construct is not working Please help me. Thank you

php

  class vp_session {public function __construct () {if (session_id () == '' || session_status () = = PHP_SESSION_NONE ||! Continue ($ _ session)) {session_start (); }} Public Stable Working Set Session ($ key, $ value) {$ _SESSION [$ key] = $ value; } Public stable work getSession ($ key) {return $ _SESSION [$ key]; } Delete public stable work session ($ name) {without set ($ _ session [$ name]); } Public static function session Destroy () {session_destroy (); }}  

Calling vp_session :: setSession ("user_id", "$ this-> user_id");

Error undefined variable: _SESSION

The method (s) are using.
If you make a call:

  vp_session :: removalSession ();  

Your constructor will not be automatically asked. You should either:

  1. Do not use static methods: a new vp_session () object, or should: Istanciate

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -