Welcome Guest, Not a member yet? Register   Sign In
ci cookies to show popup-add 1 hr interval

i am new to php, ci and also in this forum.
i want to show a popup-add once an hour. after 1 hour, if the user refreshes the page, the add will be shown again. but if user refreshes the site within 1 hour, the add won't be shown. can i do it using ci built-in class using cookies? or there is any other way. pls suggest...

thanks in advance.

CI has it out of the box ;o) You should use the session driver instead of the cookie helper.


The example shows a message for 60 seconds.

$this->session->set_tempdata('example', 'Hello folks!', 60);

later in your workflow you can call.

echo $this->session->tempdata('example');

The set_tempdate method couldnt called in the same controller method because it would be allways overwritten. So set it from another method or from another controller.


thanks Rufnex. i'll try it asap and inform u.

Theme © iAndrew 2016 - Forum software by © MyBB