Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php delete session

session_destroy(); // To delete whole session
// OR
unset($_SESSION['myVar']); // To delete a session var
Comment

destroy session php

<?php 
 session_start(); // start session
 session_destroy();  // Delete whole session
// OR
unset($_SESSION['username']); // delete any specific session only
?>
Comment

php session destroy

<?php
// Destroy the currently active session.
session_destroy();
?>
Comment

destrroy a session php


<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

// Finally, destroy the session.
session_destroy();
?>

Comment

Destroy Session PHP

<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

// Finally, destroy the session.
session_destroy();
?>
Comment

PREVIOUS NEXT
Code Example
Php :: how to rename uploaded file in codeigniter before upload 
Php :: php check if class exists 
Php :: open json file php 
Php :: push key value array php 
Php :: array constant in php 
Php :: use multiple pagination in same page laravel 
Php :: wpdb get results foreach 
Php :: regex get text between braces 
Php :: carbon get day name from date 
Php :: redirect to attempting url after login laravel 
Php :: laravel blade shorthand if 
Php :: laravel collection push 
Php :: Merge Two Collection ( Laravel ) 
Php :: export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH 
Php :: every wordpress page redirect to localhost ? 
Php :: php get all in object as array 
Php :: php if 
Php :: set cookie one day php 
Php :: add time to a date php 
Php :: php get this week date range 
Php :: destory session in laravel 
Php :: insert data using model in laravel 8 
Php :: round to 2 decimal places php 
Php :: set postman global variable header 
Php :: set value in session php 
Php :: php set status code 
Php :: php get option value 
Php :: the requested php extension bcmath is missing from your system 
Php :: laravel generate unique db token 
Php :: php artisan queue table 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =