Get current session in WP admin
Trying to access sessions in the WP admin and access a variable from it.
function tasks_admin_sessions() {
if(!session_id()) {
session_start();
}
}
add_action( 'admin_init', 'tasks_admin_sessions', 1 );
$nonce = $_session['wp_nonce']
$completed_url = admin_url( "post.php?post=$post_idaction=trash_wpnonce=$nonce" );
but I get:
Notice: Undefined variable: _session
What am I missing in my code to get the session variables?
Topic admin-init session wp-admin Wordpress
Category Web