Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Verifying a login cookie

unset($username);
if (isset($_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 (isset($username)) {
   print "Welcome, $username."; 
}else{
   print "Welcome, anonymous user."; 
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel app not loading on server 
Php :: laravel dispatch execute multiple 
Php :: Call to undefined method :last() 
Php :: word limit in php 
Php :: Laravel array to string error 
Php :: cf7 first_as_label 
Php :: how to find number between different ranges in php 
Php :: remove public from url laravel 
Php :: factorial program in php 
Php :: bin/cake cache clear_all 
Php :: wordpress get_permalink not working 
Php :: fxcjahid 
Php :: selecting a time zone from a drop-down list 
Php :: rollback a specific migration laravel 
Php :: laravel class is not recognized in tinker 
Php :: keep track of view count php 
Php :: how to stop message of laravel mix 
Php :: laravel required_if fileld has value 
Php :: Remove default product data tabs 
Php :: share var in a maser layout laravel 
Php :: Google Dorks Using special search string for Web Server Detection 
Php :: upload video file using ajax php 
Php :: wordpress not logging when using ngrok 
Php :: leaf php 
Php :: php int to indonesian rupiah 
Php :: in connection.php line 664: could not find driver (sql: select * from information_schema.tables where table_schema = news and table_name = migrations) in connector.php line 67: could not find driver 
Php :: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/7.4.29 Server at localhost Port 8080 
Php :: php send values in $_SESSION to other page 
Php :: wp site url link from admin 
Php :: Syntax error or access violation: 1055 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =