pirnt_r($_SESSION)
not print all value.
But we log in wordpress admin and preview page when we write print_r($_SESSION)
they display all session variable with value.
Thank you.
pirnt_r($_SESSION)
not print all value.
But we log in wordpress admin and preview page when we write print_r($_SESSION)
they display all session variable with value.
Thank you.
Can you show us the whole code?
Probable cause:
print_r($_SESSION)
not pirnt_r($_SESSION);
echo
before print_r($_SESSION);
as in echo print_r($_SESSION);
Wordpress doesn't use session's to log their users in, so if you log in at /wp-admin there are no $_SESSION variables set. Wordpress also doesn't call session_start(). This means you have to start the session yourself if you haven't done so already.
You can do this in the following way:
if ( ! session_id() )
session_start();
If you know the session has not been started already you can use just session_start, like so:
session_start();
If you do this your $_SESSION array should contain the variables you put in it previously.
You can write your question here: https://wordpress.stackexchange.com/ maybe more helpful