• If I have a transient named “test” is that transient unique to a session or is it the same “test” transient for another session that would start and access it?

    TIA

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you’re using the transient api, it’s not related to a session unless you take steps to make it so. https://codex.www.ads-software.com/Transients_API

    Thread Starter lwoods

    (@lwoods)

    Thanks for your response but I am using the API and read it carefully and there isn’t any mention—that I could find—about whether the transient was system-wide or unique to a session. Could you direct me to the citation?

    Thanks

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    When I have used transients, they relate directly to the key. So when you use get_transient, it looks to see if there is a transient with that key that hasn’t expired. There’s nothing session related in the code. Transients != Cookies

    Thread Starter lwoods

    (@lwoods)

    Thanks for the quick response, Steve. So, how do I define a unique transient by session? SessionID?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What are you trying to accomplish?

    Thread Starter lwoods

    (@lwoods)

    I am linking between pages and using the transient to pass state information between the pages. The problem is that there could easily be multiple users accessing these pages so if there is only one transient system-wide then there is a good chance that users will be overlaying the transient.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You should be using session cookies for that, not database-housed transients.

    Thread Starter lwoods

    (@lwoods)

    Good point. I’ll look at that. Only problem that I see is that I am saving a LOT of data between pages.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Is a Transient unique to a session?’ is closed to new replies.