calling wp_current_user() in wordpress makes non jquery

I am creating website in WP with s2member plugin.I used these few lines inside where I used the s2member member code

 $current_user = get_current_user_id(); / get current looged in user ID
    $_SESSION['id']=$current_user;  // put that in session

I have queries that is this the right way to set session in WP? (I used set_session on top)
Results:

Read More
  • The jquery doesn’t run after if uncomment above code..
  • The grey bar on top of WP that shows current logged in user becomes complete blank,it doesn’t show any logged in user.

    bar while commented code

I thnk that there is different way to set session in WP or it doesn’t allow you to do so..
Any help in this regard.
Thanks

Related posts

Leave a Reply

1 comment