Results 1 to 4 of 4

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Paladin tank in the field Dare_Devil's Avatar
    Join Date: Jan:2005
    Location:
    Posts: 939

    PHP session_destroy()

    index.php :
    PHP Code:
    <?php
    session_start
    ();
    header("Cache-control: private");

    $logout=$_GET[logout];
    if (( 
    $logout == 1)) {
    session_destroy();
    }

    /*Check the session*/
    if ($_SESSION["access"] == "granted")
      include(
    "adminpanel.php");
    else
      include(
    "login.php");

    ?>
    login.php , POST- validate.php, :

    PHP Code:
      if (mysql_fetch_row($result)) {
      
    /* access granted */
      
    session_start();
      
    header("Cache-control: private");
      
    $_SESSION["access"] = "granted";
      
    header("Location: index.php");
    } else
      
    /* access denied => redirect back to login */
      
    header("Location: index.php"); 
    . adminpanel.php :
    HTML Code:
    <a href="index.php?logout=1"></a>
    index.php logout=1, index.php . , , , .
    header("Location: index.php"); session_destroy();, : Warning: Cannot modify header information - headers already sent
    ?
    | ASRrock Fatal1ty Z97 Killer | Intel Core2 i5 4690K | 4x4GB DDR3 2400MHz Corsair Vengeance Pro | SSD 120GB, Corsair Force SATA III | Western Digital Caviar Green 1TB 5400rpm SATA II | Gainward GTX1060 3GB GDDR5 | Cooler Master HAF-912 | CoolerMaster SilentPro M700 |

  2. #2
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    . :
    session_unset();

    $_SESSION = array();
    . - .
    . session_destroy :
    header("Cache-control: private");
    , . .

    , , .
    , . , .
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  3. #3
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Bombera session_unset(), cookie - ( - .. - 1 , ). , timestamp-a ( , ).

  4. #4
    Paladin tank in the field Dare_Devil's Avatar
    Join Date: Jan:2005
    Location:
    Posts: 939
    , session_unset() .
    | ASRrock Fatal1ty Z97 Killer | Intel Core2 i5 4690K | 4x4GB DDR3 2400MHz Corsair Vengeance Pro | SSD 120GB, Corsair Force SATA III | Western Digital Caviar Green 1TB 5400rpm SATA II | Gainward GTX1060 3GB GDDR5 | Cooler Master HAF-912 | CoolerMaster SilentPro M700 |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |