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

[Solved] Check if logged in : Which function does that?*

edited March 2012 in Vanilla 2.0 - 2.8

Im pretty new to Vanilla, so i wanted to know, which function exactly checks if the user has logged in?

Best Answer

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    On the server:

    if (Gdn::Session()->IsValid()) { ... }
    

    In javascript:

    if (gdn.definition('SignedIn', '0') != '0') { ... }
    

Answers

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    On the server:

    if (Gdn::Session()->IsValid()) { ... }
    

    In javascript:

    if (gdn.definition('SignedIn', '0') != '0') { ... }
    
  • Options

    Thanks worked!

  • Options

    What needs to be imported to check for a vanilla session on other pages not a part of vanilla?

Sign In or Register to comment.