Tuesday, 10 September 2013

Removing session with key starting with specific characters

Removing session with key starting with specific characters

How can i remove, unset session variables starting with key pattern like
Where keys like
Guard_1660743344
Guard_4323340344
Guard_5343332233
.....
Guard_[dynamicvalue]
I want to remove all session variables from tray if session key started
with "Guard_"
unset($_SESSION[$key]);
Sorry i tried my best to find solution but failed, therefore asked

No comments:

Post a Comment