HtmlWorkshop

HtmlWorkshop

RemoveFromSession Use Examples

Basic RemoveFromSession Use

In this example we have a button process which first tries to retrieve our TestVariable. If it is not found, it adds it and we try to retrieve it again.

 

This time it will work and we output the value of the variable to the user in a message.

If the variable was found, we remove it from the session. The RemoveFromSession returns a “True” or “False” depending on whether it was successful. Once it is removed, we try to retrieve it again.

Now, when we output the message to the user, it will be blank because the variable no longer exists.