Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Why can't I access the LussumoUserID session variable?
I've tried everything, and I still can't access the User ID session variable. I can get info from the cookies fine, but nothing from the session
That bit of code returns nothing. I've logged in with the "remember me" unchecked and checked... still nothing. Any suggestions?
session_start();
echo $_SESSION['LussumoUserID'];
That bit of code returns nothing. I've logged in with the "remember me" unchecked and checked... still nothing. Any suggestions?
0
Comments
Just check (see the cookies) that your session is not named differently that the standard PHPSESSID Vanilla use.
BTW, I intend to open a topic on this subject: name the session to something unique to avoid unwanted mix of session variables on a multi purpose server.
Regardless, the session name is a configuration variable - so if you are concerned about having two vanilla forums that clash, you can just change it in your second forum using the $Configuration array.
session_name('LUSSUMO or whatever you want');
before callingsession_start();
This way if one is using two different PHP web-app on the same server the session spaces are distincts. Moreover the PHP session cookie is now clearly identified rather than being PHPSESSID.LussumoUserID is not the session NAME it is a session variable you are using to identify your own Vanilla session.
1. How do I determine if someone is signed in (having not checked the Remeber Me box) strictly through sessions?
2. How can I extract the User ID from that variable?
Unfortunately, this code doesn't work.
@bjork: That code *should* work. Try this to see what the session *does* contain:
print_r($_SESSION);
print_r($_SESSION);
That line of code returns an empty array.
error_reporting(E_ALL)
does anything show up when you try to start the session?My PHPSESSID cookie contains what looks like an md5 hash, but I still can't find any direct sessions related to Vanilla.
I mean the real script, not the bit you posted above.
1. Logout of Vanilla completely
2. Clear my cookies and cache (just to be safe)
3. Log back in, without checking the "Remember Me" box
4. Call a page with the following script:
error_reporting(E_ALL); session_start(); print_r($_SESSION); print_r($_COOKIE);
And receive the following:
Array() Array([PHPSESSID]=>####hash####)
This is soooooo frustrating, as I have no problem at all with the cookies, which are supposed to be more difficult to work with than the sessions.
i mean, you're calling it from within vanilla? is it an extension?
nevermind, i missed the part where you got the cookie OK.. hmm
echo($_SERVER['HTTP_HOST']);
and make sure it matches exactly the hostname you're using in the browser. (including or excluding www or whatever)
can you view your raw error log?