php - is_logged_in function always return false for http://domain.com/wordpress -


is_logged_in() function return false

i believe because wordpress hosted in sub domain due cookies not correct path.

so tried using define('cookie_domain', './wordpress'); in wp-config.php

it not working.

am setting cookie right?

please !!

try this

<?php if ( is_user_logged_in() ) {     echo 'welcome, registered user!'; } else {     echo 'welcome, visitor!'; } ?> 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -