/    Sign up×
Community /Pin to ProfileBookmark

i need a function

does anybody know a function that returns a boolean value to tell whether a user is logged in?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@hastxMar 31.2008 — Logged in how? cookies, sessions ...
Copy linkTweet thisAlerts:
@MrCoderApr 01.2008 — If you are talking about .htaccess logged in method then you can check that with one of the $_SERVER values, cant remember the name of it off the top of my head. Do a var_dump($_SERVER);
Copy linkTweet thisAlerts:
@PreamauthorApr 02.2008 — hastx,

thats clever

"We do precision guesswork"

I meant by cookie,

thanks for your help by the way
Copy linkTweet thisAlerts:
@PreamauthorApr 02.2008 — MrCoder for future reference that is php_auth_user
Copy linkTweet thisAlerts:
@MrCoderApr 02.2008 — MrCoder for future reference that is php_auth_user[/QUOTE]

Thanks, but I never use it, haven't done for years.
Copy linkTweet thisAlerts:
@NogDogApr 02.2008 — [url=http://www.php.net/isset]isset[/url]() will return a boolean based on whether a specified cookie was received from the browser, if that is what you are asking:
[code=php]
$booleanValue = isset($_COOKIE['cookie_name']);
[/code]
×

Success!

Help @Pream spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...