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.

How can I get the session state in the master view?

edited September 2009 in Vanilla 2.0 - 2.8
Q1, Is there and variables list that can be accessed in master view? I want to know whether the visitor logined or not.

Q2, It seems that if I want to customize the assets (like menu) show the page, I have to modify the source code but not in the view, right?


  • MarkMark Vanilla Staff
    A1. You can see if the user has an active session by doing this:

    $Session = Gdn::Session(); if ($Session->IsValid()) { // do something

    A2. You can modify the source code by copying the views that you want to change into your custom theme folder and editing them there. There is more documentation on it here:
Sign In or Register to comment.