Search
 
SCRIPT & CODE EXAMPLE
 

PHP

verify that a valid login cookie was sent in order to do special things for that logged-in

unset($username);
if ($_COOKIE['login']) {
    list($c_username,$cookie_hash) = split(',',$_COOKIE['login']);
    if (md5($c_username.$secret_word) == $cookie_hash) {
        $username = $c_username;
    } else {
        print "You have sent a bad cookie.";
    }
}

if ($username) {
    print "Welcome, $username.";
} else {
    print "Welcome, anonymous user.";
}
Comment

PREVIOUS NEXT
Code Example
Php :: htmlentities (PHP 4, PHP 5, PHP 7, PHP 8) htmlentities — Convert all applicable characters to HTML entities 
Php :: Namespace declaration statement has to be the very first statement or after any declare call in the script in file D:Xampphtdocsprojectsmulti_vender_siteappModelsUser.php on line 5 
Php :: laravel many to many relationship with pivot table 
Php :: Best version control tools for php 
Php :: simple-phpunit --version handling the phpunit-setup event returned with error code 127 on ubuntu 
Php :: use scope in statamic template 
Php :: Display HTML text from a variable in laravel 
Php :: PHP code to redirect a user from a page to an alternate destination 
Php :: hp 5 minute later from current date time 
Php :: answer to guzzle/psr7 undefine 
Php :: update query in laravel eloquent 
Php :: pivot null in livewire refresh 
Php :: laravel route where not contain 
Php :: Metabox Array 
Php :: trim string in php codeigniter 
Php :: desactivar estilos globales wordpress 5.9 
Php :: learndash logo link 
Php :: laravel project preparation,laravel project create 
Php :: Reference — What does this symbol mean in PHP? 
Php :: laravel create pivot migration 
Php :: PHP vprintf — Output a formatted string 
Php :: dynamic base url 
Php :: call node js jquery http php 
Php :: how to get many of quensation php programming language 
Php :: order table in laravel 
Php :: How to Create a Transient PHP wordpress 
Php :: how to get create table query preview in phpmyadmin 
Php :: 150 charachter display only php 
Php :: woo show Cross-Sells 
Php :: php pdo memory exhausted 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =