0

I am coding a plugin and it seems wordpress discourage use of Sessions. I have a kind of wizard for non-logged in users that asks for First Name, Last Name etc and some conditional questions from users in 4 different steps and then eventually registers user and shows his username/pass in last step.

I am stuck on this last step since I am not able to hold data in sessions. Should I even use Transients API to hold this kind of data? How can I make Transients data a non-logged in user specific? Don't want to use cookies or you think I must use cookies in this scenario?

2
  • 1
    What is wrong with sessions?
    – fuxia
    Commented Jan 8, 2013 at 22:05
  • should I go for PHP sessions? It seems wordpress discourages use of session to keep itself stateless. Just trying to do things wordpress way and keep myself updated.
    – mysterious
    Commented Jan 8, 2013 at 22:15

1 Answer 1

1

Use sessions when they are appropriate.

Our fellow mod @EAMann has written a useful session class for exactly these cases. There is a plugin described here that offers a different API.

Just make sure to start the session only when you really need one. Google and other crawler don’t accept cookies, so you would end up with lots of duplicated URLs indexed like this:

/postname/?sid=123455667889

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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