How do I delete all session variables at once if they are not in Array?
PS I set them this way:
$this->getUser()->setAttribute('PayPalTransaction.hash', $request->getParameter('hash'));
Regards,
Roman
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
sfUserclass (which you get with$this->getUser()), keeps all it’s attributes in asfNamespacedParameterHolder. So thesetAttribute()function onsfUserif merely a proxy to thesfNamespacedParameterHolder::setAttribute(). You can get the reference to this holder withsfUser::getAttributeHolder().The
sfNamespacedParameterHolderalso has a functionclear(), which clears all attributes.So to clear all attributes, use:
$this->getUser()->getAttributeHolder()->clear().(Please note that you will still be authenticated (e.g. logged in) when you clear the attribute holder).