Forums

How to get current user from an applet? (4 posts)

  1. accion mutante
    Member
    Posted 11 months ago #

    Hi,
    I want to get the current user id from within an applet, don't want to pass it as an applet param for some security reason.
    I don't uderstand how wordpress retrieve the current user, it must be a session id somewhere in the database right?

    Does anyone get an idea?

  2. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 11 months ago #

  3. accion mutante
    Member
    Posted 11 months ago #

    Hi,
    thank you but neither get_currentuserinfo() or wp_get_current_user() can work (I still tested these both methods).

    The reason, I think, is that the applet can not recognize the session so that I get always an ID == 0.

    I wonder how wordpress can return a current user with the above methods, I looked at the code but I don't get it.

    Does it use cookies? session id in database?

  4. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 11 months ago #

    Probably cookies, but you'll have to dig into the source code.

Reply

You must log in to post.

About this Topic