Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
What sessions vanilla uses?
Ok i have php chat that i wrote myself and i have vanilla.
Chat location is http://localhost/chat amd vanilla location is http://localhost/forum.
Now how do i pull vanilla username from PHP?
I ask for something like this: $_SESSION['username'] and $_SESSION['is_logged']?
Chat location is http://localhost/chat amd vanilla location is http://localhost/forum.
Now how do i pull vanilla username from PHP?
I ask for something like this: $_SESSION['username'] and $_SESSION['is_logged']?
0
Comments
1. Vanilla uses the cookie called "Vanilla" by default.
2. To get the current UserID try: 3. To get the current username you'll have to go to the db. The table you want is GDN_User and your query needs to be something like:
It worked.
Ok but i see that user can change his cookie.
Is there any way i can test about that?
It think that answer is in other parts of cookie.
http://vanillaforums.org/discussion/16326/recognizing-authenticated-users-outside-the-forum
And this code:
define('APPLICATION', 'Vanilla');
define('APPLICATION_VERSION', '2.0.16');
define('DS', '/');
define('PATH_ROOT', 'path-to-forum');
ob_start();
require_once(PATH_ROOT.DS.'bootstrap.php');
ob_end_clean(); // clear any header output from vanila
$Session = Gdn::Session();
$Authenticator = Gdn::Authenticator();
if ($Session->IsValid()) {
$Name = $Session->User->Name;
echo "You are logged in as $Name";
} else { echo "You are not logged in"; }
Breaks my page!!!
Im looking for any costume way to check for user authorizastion.
i dont have $Session variable.
Now i want function that will check if cookie is valid.
And i want it to 100 % stand alone.
$Session returned is an Object, var_dump it or print_r it and you'll get the values
if your need it in $_SESSION, create and pass it there
e.g.
$_SESSION['vanilla'] = $Session;