Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
What is wrong with sessions? –  toscho Jan 8 '13 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 Jan 8 '13 at 22:15

1 Answer 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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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