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.

[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

  • ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    On the server:

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

    In javascript:

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

Answers

  • ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    On the server:

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

    In javascript:

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

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