I'm looking for a way to start a single PHP session, but nothing seems to work.
I've tried doing like this:
session_start($_SESSION['check_rank']);
But it didn't work.. I got the following error:
PHP Notice: Undefined variable: _SESSION in /Applications/MAMP/MyProjects/teste/teste.php on line 4
PHP Warning: session_start() expects parameter 1 to be array, null given in /Applications/MAMP/MyProjects/teste/teste.php on line 4
Is there a way to start only a single section?
What is a "single" PHP session? Never heard of it.
session_start() takesno parameter, it just starts the session. If you want to call/start a named session, you have to use session_name().
e.g.
<?php
session_name("my-session");
session_start();
$_SESSION is to store session variables,
e.g.
<?php
session_name("my-session");
session_start();
$_SESSION["foo"] = "bar";