i am new in wordpress i am want to start a session in wordpress i am using this code in theme head to start session

add_action('init', 'register_my_session');                                  

 // session function

            function register_my_session(){
                                                  if( !session_id() )

// calling session function


if this code is ok then where i have to add this code in wordpress to start session

Read more here: how to start session in wordpress


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: