Don't forget to hit the ⭐ if you like this repo.
- a)
$_POST
- b) By checking if
$_SERVER['REQUEST_METHOD']
is equal to 'POST' - a)
session_start()
- a) By assigning a value to
$_SESSION['variable']
- a) To destroy all session data
- a) By accessing
$_SESSION['variable']
- a)
setcookie()
- a) By accessing
$_COOKIE['cookieName']
- a) By setting the cookie with an empty value and an expired timestamp
- a) To convert special characters to HTML entities
- a)
isset()
- a) By using
htmlspecialchars()
to encode the output - a)
isset()
- a) By setting the cookie with an expiration timestamp in the future
- a) To regenerate the session ID to prevent session fixation attacks
- a) By assigning the array to
$_SESSION['variable']
- c)
is_null()
- a) By accessing
$_POST['fieldname']
- a) To close the session and write session data
- a) By regenerating the session ID after successful login
- a)
session_id()
- a) By using the
unset()
function on$_SESSION['variable']
- a) To remove all session variables
- a) By setting the cookie with an expiration timestamp in the past
- a) To retrieve the current session ID
- a) By using
empty($_SESSION['variable'])
- d)
ini_set('session.gc_maxlifetime')
- a) By using
empty($_COOKIE['cookieName'])
- a) To encode a string for safe use in a URL
- a) By using the
count()
function on$_SESSION['array']
- a)
session_is_active()
- a) By using
isset($_POST['checkboxName'])
- a) To perform garbage collection on expired session data
- a) By serializing an array and assigning it to the cookie value
- a)
session_is_started()
- a) By using a secure session ID generated with a secret key
- a) By using
empty($_SESSION)
- a) To discard session changes and close the session
- a) By checking if a session variable representing the user's login status is set
- d)
$_COOKIE['secure']
- a) By setting the
HttpOnly
flag when setting session cookies - a) To perform garbage collection on expired session data
- a) By modifying the
session.gc_maxlifetime
configuration directive - a)
$_COOKIE['cookieName']
- a) By checking if a session variable representing the user's admin status is set to true
- a) To destroy all session data
- a) By accessing
$_COOKIE['cookieName']
- d)
setcookie()
function with thedomain
parameter - a) By regenerating the session ID after successful login
- b) To set the save path for session files
Please create an Issue for any improvements, suggestions or errors in the content.
You can also contact me using Linkedin for any other queries or feedback.