Forums

[SOLVED] Empty data session

laurentmartin 24 Jun, 2012
Hello,

I was wondering how to empty a data session when clicking on a link ?
GreyHead 24 Jun, 2012
Hi laurentmartin,

You can't do it *just* by clicking on a link but you could have the link go to a form that empties the session data and then passes the user on somewhere else.

Bob
laurentmartin 24 Jun, 2012
Hi Greuhead,

Yes, this is what i need to do : Click on a link in an article, it load my form and empty the data session before displaying the form.

How to do this ?
GreyHead 18 Aug, 2012
Hi laurentmartin ,

In a CustomCode action in the On Load event
<?php
$session =& JFactory::getSession();
// change the next two lines if you have specified a session key or namespace
$session_key = $form->form_details->name;
$session_ns = 'default';

$session->clear('_chronoform_data_'.$session_key, $session_ns);
?>


Or possibly better if it will work with your process flow: Turn on the Clear session option in the last Session to Data action so that it isn't stored.

Bob
laurentmartin 16 Feb, 2013
Hi Bob,
Thanks for the advice i used this: "Turn on the Clear session option in the last Session to Data action"
It worked weel
This topic is locked and no more replies can be posted.