如何在页面刷新后“保存”复选框的状态

I'm trying to memorize the status of the check box for a preferences page. The status should remain selected or deselected according to the user's choice.

<div class="tab-pane" id="Notifiche">
    <div class="row">
        <div class="col-sm-4">
             <h5>Able/Disable Notify</h5><br>
        </div>
        <div class="col-sm-4">
            <label class="container">
               Able <input type="checkbox" name="check" value="1" <?php if (isset($_POST['check'])) { echo ($_POST['check']=='1' ? 'checked' : '');}?> >
           <span class="checkmark"></span>
           </label>
        </div>
        <div class="col-sm-4"></div>
    </div>
</div>

after page refresh it returns to normal state

you can achieve this by using local storage

like this way u can store

window.localStorage.setItem('user', val);

and this way can get on page refresh

window.localStorage.getItem('user');