#1 March 2, 2014 9:25pm

Damienov
Member
Registered: March 2, 2014
Posts: 14

Detect Session

Hi, is there any way to detect user logged in session?

for example:
If Admin is logged in > show this DIV

Offline

#2 March 2, 2014 10:50pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Detect Session

The easiest way is to use:

if ($_SESSION["bigtree_admin"]["id"] && $_COOKIE["bigtree_admin"]["email"]) {
}

The reason we check both the session and the cookie is in case there are two BigTree installs on the same domain (the session is set per domain, the cookie is properly set to the directory of the site).

Offline

#3 March 2, 2014 11:25pm

Damienov
Member
Registered: March 2, 2014
Posts: 14

Re: Detect Session

Thanks a lot smile

So I'm guessing if I want to check it against users it would be?
if ($_SESSION["bigtree_user"]["id"] && $_COOKIE["bigtree_user"]["email"]) {
}

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.