• Hi, I want to use the login data of a user to create a php session (to protect some pages basically).
    I saw some functions like get_userdata or get_currentuserinfo but I’m not sure what’s the difference between these 2.
    Also I could not find examples around. Can anyone tell me what’s the best way to proceed?
    thanks
    B.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Is it the whole WordPress installation or just specific posts you wish to protect?

    The reason I’m asking is that you can lock down the whole installation using a plugin for authenticated users or just password protect the posts.

    https://www.ads-software.com/plugins/search.php?q=member

    https://codex.www.ads-software.com/Using_Password_Protection

    That may be easier than using $_SESSION and likely safer too.

    Thread Starter balux

    (@balux)

    Hi, thanks.
    no, it’s just some pages of the website that I wrote (to manage the db)
    Once the admin will be logged in, there will be a link in the footer to the home page of the db section..I’d like to start a session with the same data the admin used to log into wp (otherwise I have to do another login page for the db section)..Hope I was clear

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘use login data for php $_SESSION’ is closed to new replies.