0

I am creating a plugin. In this plugin I have shortcodes that provide some logic and content for pages. This way I have created 'Page A' and 'Page B'. Both of the pages will redirect user to external page. The external page is not written by me and will not process any of my $_GET or $_POST values. Then this external page will redirect user back to my plugin 'Page C'. Now how to make 'Page C' know if the external page was reached from 'Page A' or 'Page B'? Normally I would use sessions, but I have read that wordpress does not support sessions. How can I do it then?

HoGo

0

I really have no idea what you're implementing here - I don't know how a plugin "has pages," for instance. As such, I'm afraid I cannot offer you much help in the way of an example, but I'm confident that what you ask could be accomplished using the Transients API, or its ascendant the Options API (preferably Transients as Options exist indefinitely and you seem to only require the data temporarily, for the duration of a couple page requests).

  • 1
    Maybe I was not specific enough. The pages are created with shortcodes. There is a pageX with shortcodeX which provides the content and logic for this page. I have corrected my question, to make it more understandable. – HoGo Jan 8 '13 at 9:51
  • This solution will be able to save a value, but it will be the same for all users. And I need it to be it different for every user that goes through those pages. – HoGo Jan 9 '13 at 23:07
  • Append the current user's id/username to whatever option/transient key you are using, and problem solved :). If it's an unregistered user, create a unique id for the visitor and append that. – bosco Jan 10 '13 at 17:24
0

WordPress itself doesn't use sessions, but there's nothing to prevent you from using them yourself within WordPress. Add a function hooked to init and start your session there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.