Osclass forums

Development => Development => Topic started by: WEBmods on June 26, 2019, 01:34:04 am

Title: [SOLVED] Clearing form session values?
Post by: WEBmods on June 26, 2019, 01:34:04 am
Hello!

I have a plugin that saves data in the session like this:

Code: [Select]
<?php
Session
::newInstance()->_setForm('ur-review'Params::getParam('review'));
Session::newInstance()->_keepForm('ur-review');
?>


The session values are used to show them back on the form if an error occurs while verifying the data user submitted.
That part works, but in case I visit the same site again the values from the previous post are still in the form.

So how can I clear those session values?

Thanks, regards.
Title: Re: Clearing form session values?
Post by: WEBmods on June 30, 2019, 12:26:10 am
Been looking at the wrong place...

Code: [Select]
Session::newInstance()->_dropKeepForm(); // ALL form values.

Code: [Select]
Session::newInstance()->_dropKeepForm($key); // SPECIFIC form value.

Regards.