Is it good practice to override cookie expiration setting?

I see the use of the following code snippet:

    $cookieexpiry=(time()+21600);
    setcookie("rwphp","$cookieid",$cookieexpiry,"/",$_SERVER["HTTP_HOST"],0);
    unset($cookieexpiry);

Q1> My question is whether it is really good practice to cancel $ cookieexpiry.

Q2> In general cases, when should I disable variables?

thank

+5
source share
3 answers

The only thing unset does in this case is to free the $ cookieexpiry variable. This will not affect your cookie.

I think you are a little confused because of the name of your variable, but all $ cookieexpiry is a number representing time and nothing more.

, unset , , -, , , .

+1

. . , , , , - , .

, - .

unset()

, - . ovais.tariq

+5

cookieexpiri, , , .

unset , , , , ,

+1
source

All Articles