Jump to content

Search the Community

Showing results for tags 'session_destory()'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. I wonder why session_destroy() does not work on the page (destroy_session.php). Set the session: http://learntolive.x10.mx/PHP/Sessions/set_sessions.php <?phpsession_start();$_SESSION['username'] = "username1";$_SESSION['password'] = "password1";$_SESSION['array'] = array('array0','array1','array2');?><html><head><script type="text/javascript">var sPageFullPath = String(window.location.href);var iDelim = sPageFullPath.lastIndexOf("/");var sPageRootPath = sPageFullPath.substring(0,iDelim+1);var iCount = 3;var iTimerCount = iCount*1000;var sRedirectURL = "get_sessions.php";window.onload = CountdownTimer;function CountdownTimer(){ if (iCount>0) { document.getElementById("CountdownTimer").innerHTML = "This page will redirect in "+iCount+" seconds to " + sRedirectURL; iCount--; setTimeout("CountdownTimer()",iTimerCount); } else { window.location = sPageRootPath + sRedirectURL; }}</script></head><body><p>This page assigns values to SESSION valuables.</p><p id="CountdownTimer"></p></body></html> Get the session: http://learntolive.x10.mx/PHP/Sessions/get_sessions.php <?phpsession_start();echo "This page shows values to SESSION valuables."."<br />";echo "The username is ".$_SESSION['username'];echo "<br />";echo "The password is ".$_SESSION['password'];echo "<br />";echo "The array is ".$_SESSION['array'][2];echo "<br />";foreach ($_SESSION['array'] as $value){ echo $value; echo "<br />";}echo "<hr />";print_r ($_SESSION);echo "<hr />";?><html><head></head><body><a href="destroy_sessions.php" title="This page will destroy the session valuables.">destory sessions</a></body></html> Destroy the session: http://learntolive.x10.mx/PHP/Sessions/destroy_sessions.php <?phpsession_start();echo "This page desttoys the session.";echo "<br />";session_destroy();echo "Those sessions set will not be shown now.";echo "<br />";echo "The username is ".$_SESSION['username'];echo "<br />";echo "The password is ".$_SESSION['password'];echo "<br />";echo "The array is ".$_SESSION['array'][2];echo "<br />";foreach ($_SESSION['array'] as $value){ echo $value; echo "<br />";}echo "<hr />";print_r ($_SESSION);?> On the above PHP page, the session valuables are still shown properly.
×
×
  • Create New...