Advertisement:

Author Topic: [SOLVED] Clearing form session values?  (Read 116 times)

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
[SOLVED] Clearing form session values?
« 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.
« Last Edit: June 30, 2019, 12:26:18 am by patrickFromCroatia »

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: Clearing form session values?
« Reply #1 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.