Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetEnv session.use_cookies='0';
- ini_set('session.use_cookies', '0');
- <?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 (isset($_COOKIE[session_name()])) {
- setcookie(session_name(), '', time()-42000, '/');
- }
- // Finally, destroy the session.
- session_destroy();
- ?>
- if( !array_key_exists('sessionid', $_POST) ) {
- // recreate the sessionid
- $sessionid = md5(rand().' '.microtime()); // Or something
- } else {
- $sessionid = $_POST['sessionid'];
- session_id($sessionid);
- session_start();
- <input type='hidden' name='sessionid'><?= session_id() ?></input>
Add Comment
Please, Sign In to add comment