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:
- Do not use static methods: a
new vp_session ()
object, or should: Istanciate
Comments
Post a Comment