Difference between is_user_logged_in and $_session[‘uname’]

The Core function for checking whether a user is logged in is is_user_logged_in(). You should use that if at all possible.

WordPress does not use sessions at all, by default, and never has so far as I can remember. When I try var_dump($_SESSION); I get an “Undefined variable” Notice exactly as I expected. I haven’t explicitly tested with the latest release but I doubt it introduced such a radical change.

If your site uses sessions, it is not the Core doing it. There must be a plugin involved. If that plugin uses sessions as a part of a custom login system you may have to use $_SESSION['uname'] but hopefully your plugin is written such that is_user_logged_in(), which is pluggable, works correctly with the custom login system.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)