We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Addons, Members

Setting member tag

Drew. I have a code block that sets a member tag and this is working great.

In my next code block I have an if tag NOT set run this block, but no matter what it runs the code anyways.

It's almost like after setting a new tag, you have to force the member to login again for the tag to take effect. Is this how tagging function should work?

Also, if a member is deleted while they are logged in they can continue to do things on the member controlled pages like they are still a valid member. It's only once the browser is closed that the delete actually takes affect.

Robert Ketter

Robert Ketter 103 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can you post the code and your Diagnostic Report so we can take a look?

Rachel (Drew),

I solved the problem this morning by accident... and here is what I found

I was using perch_member_add_tag('new') then I would echo 'set tag' (lazy debug), next I would !perch_member_has_tag('new') and even though the member tag was just added and shows in the member profile the code would run as though the tag didn't exist.

WELL... once I echo headers are sent, and the rest of the code blocks testing for tags run regardless which must do with session.

This morning I was refining the code and replaced my echos with PerchUtil::debug() and everything is working flawlessly.

The lesson learned: echo is easy (less typing, lazy way) but debug should be done with PerchUtil::debug()