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.
Options

Why can't I access the LussumoUserID session variable?

2

Comments

  • Options
    Yes I can. Nothing out of the ordinary though.
  • Options
    MarkMark Vanilla Staff
    Okay, so it appears as thought sessions are working, but they may not be.

    A test you can do is to sign in and go to your profile page. Refresh the page and see if it marks your logins up by 1. If it does, then it is re-authenticating your cookies and your sessions aren't actually working properly.
  • Options
    TreyTrey Charlotte NC New
    edited September 2006
    just off the top of my head, since noone asked where is your cookie path set to? sign into the forum and then go to settings -- Application Settings and then near the bottom make sure the cookie path is / and not something like /forum/
  • Options
    yeah, that's the point, if your script is stand alone it will be run from / and will not get any cookie from a path below.
  • Options
    think i already mentioned this with vanilla 1.0 (dont know if this is still the case with 1.0.1)

    COOKIE_DOMAIN and COOKIE_PATH (as set in application settings) are only written with the 'remember' cookie, but not with the PHPSESSID cookie (as there is no session_set_cookie_params call befor session_start)... should not the PHPSESSID also be set according to cookie path and domain or do i get this wrong
    and as Max_B already mentioned there is no session_name call, that means vanilla session name is the default PHPSESSID
  • Options
    @Mark: visits does not increment when refreshing the account page. COOKIE_DOMAIN is set to http://www.mydomain.com (only it's the real URL) COOKIE_PATH is set to "/"
  • Options
    Any more suggestions? If I can't figure this out, I guess I'll just force everyone who signs in to use cookies (hide the remember me checkbox).... unless someone else has any ideas on how to remedy this problem?
  • Options
    Falling back to an elementary question: is the PHP session functionality enabled? Check your phpinfo().
    Are you able, in a test script, to save and retrieve a $_SESSION[] variable?
  • Options
    @Max: Yes, sessions are enabled. I've built several web apps that rely solely on their existence. Vanilla, however, is either not properly registering them or has hidden them so thoroughly that I'll never be able to find them.
  • Options
    ithcyithcy New
    edited August 2006
    if sessions weren't working, vanilla wouldn't be working.

    i know this is probably not going to change anything, but have you tried passing the PHPSESSID to the script in the query string?
  • Options
    edited August 2006
    @itchy: I've tried the following:

    echo $_SESSION[$_COOKIE['PHPSESSID']];
    Which, of course, does nothing.

    I have no problem accessing the PHPSESSID, so I doubt passing it via the query string would make much of a difference. I've never been so frustrated with a script before. I know the session is out there, but for whatever reason, my server refuses to show it to me. I'm just going to push cookies, and go from there.
  • Options
    well, i meant that maybe you could 'jump start' the session handler by passing "&PHPSESSID=".$_COOKIE['PHPSESSID'] to the script. the session handler in PHP is supposed to start itself automatically if the PHPSESSID query string variable exists. (it's also supposed to do that if the cookie exists, but obvously that's not working)
  • Options
    Max_BMax_B New
    edited August 2006
    I guess the culprit should be something obvious we didn't check and we are now looking too far.
    I have no problem here to acces Vanilla session variable from an external script.

    I'd like to mention that on my own test server, the cookie DOMAIN is left empty and default to localhost.local (Mac OS X Server). Unless you are running a DNS server for you domain pointing back to your test server (and reverse IP ok), I'd advice to set left it empty too. At least to test sorting this out.
  • Options
    @Max_B: do you suggest leaving the cookie DOMAIN or PATH empty? Or both?
  • Options
    edited August 2006
    @bjork24:
    as you say you can access the PHPSESSID, does it change on every page call?
    if you get an empty $_SESSION array, are cookies turned on and are you really loged in (sorry to ask you that stupid, but it happens to me something that i turn off cookies for testing...)
  • Options
    I suggest to leave DOMAIN empty and PATH to either empty or / .
  • Options
    Well, no news.
    Bjork24, did you sort this out?
  • Options
    Sorry, I was out of town for a few days... no news does not mean good news in this case. The DOMAIN / PATH emptying (as noted above) did not work. I'm really at a lose on this one. I think I'm going to force cookie login and go from there. If I ever crack the session mystery, I'll code it in.
  • Options
    edited September 2007
    never mind...
  • Options
    I thought it was this...

    Context->Session->UserID

    Or am I barking up the wrong tree?

    Posted: Monday, 10 September 2007 at 7:57AM

Sign In or Register to comment.