checkbox to stay ticked after browser refresh

hi im attempting to keep a group of tick boxes ticked after i refresh the browser in been through the forums trying different solutions but anything ive tried doesnt work if anyone has a solution to this be much grateful

after googling i have done the following but have encountered a error see below:
Warning: in_array() expects parameter 2 to be array, null given in /home/jktempla/public_html/sample/index.php on line 19