1rosehip / jplist

jPList jQuery Data Grid Controls is a flexible jQuery plugin for sorting, pagination and filtering of any HTML structure (DIVs, UL/LI, tables, etc).
http://jplist.com
Other
437 stars 176 forks source link

manually delete cookie #293

Closed thleh closed 6 years ago

thleh commented 6 years ago

Hi,

I have written an own small search fomular that pre-filters results and posts the values via POST-method to the jplist formular. Here i'm using cookies for navigation.

When i start a new search the value from the cookies will be used instead the new POST variables.

Is there any method to clean up the cookie set by jplist ? I will not fire the reset button because than i cannot handle the POST variables to get working.

I have tried to clean up the cookie in PHP with

            unset($_COOKIE[$cookie_name]);
            $res = setcookie($cookie_name, '', time() - 3600);

but without success.

Any ideas how to solve that ?

Thanks Thomas

thleh commented 6 years ago

Hi all,

finally i was able to fix it using JS (like jplist does)

        <?php   if(strcmp($search_clear_cookie,'1')==0){
            echo "document.cookie = '".$cookie_name."=\"\";-1; path=/';";   
        } ?>