deleting session variables

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default deleting session variables

    Is there a way to wipe out all previous session variables with one
    command?

    Thx

    Tim Winters
    Creative Development Manager
    Sampling Technologies Incorporated

    1600 Bedford Highway, Suite 212
    Bedford, Nova Scotia
    B4A 1E8
    [url]www.samplingtechnologies.com[/url]
    [email]webmaster@samplingtechnologies.com[/email]
    [email]csnm@samplingtechnologies.com[/email]
    Office: 902 450 5500
    Cell: 902 430 8498
    Fax:: 902 484 7115


    Tim Winters Guest

  2. Similar Questions and Discussions

    1. #39833 [NEW]: Session variables overwritten by local variables (register_globals=off)
      From: sup1382 at accedo dot es Operating system: OpenBSD 3.9 PHP version: 5.2.0 PHP Bug Type: Session related Bug...
    2. #39447 [NEW]: Want to optionally handle apc_upload_progress variables using session variables
      From: krudtaa at yahoo dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug...
    3. Deleting or Modifying Session Variables in anothersession
      Is it possible to delete or clear session variable from another session? Here's my scenario. A user opens the public part of a web site which...
    4. #25629 [Opn->Bgs]: session cookie being set to deleted when deleting a session
      ID: 25629 Updated by: sniper@php.net Reported By: john at tarot dot com -Status: Open +Status: Bogus...
    5. Session problem when setting session variables in files that are in different directories
      I am running PHP 4.3.0 on a WinXPpro machine and I recently got problem with sessions. What I am building is a loginsystem and I need to save...
  3. #2

    Default Re: [PHP] deleting session variables

    From: "Tim Winters" <csnm@samplingtechnologies.com>
    > Is there a way to wipe out all previous session variables with one
    > command?
    With register_globals OFF:

    $_SESSION = array();

    If register_globals is ON and you want to get rid of $val1, $val2, $val3,
    etc... then:

    foreach($_SESSION as $key => $value)
    { unset($$key); }

    ---John Holmes...

    Cpt John W. Holmes Guest

  4. #3

    Default RE: [PHP] deleting session variables

    Thanks,

    So what does session_unset() do then?

    Tim Winters
    Creative Development Manager
    Sampling Technologies Incorporated

    1600 Bedford Highway, Suite 212
    Bedford, Nova Scotia
    B4A 1E8
    [url]www.samplingtechnologies.com[/url]
    [email]webmaster@samplingtechnologies.com[/email]
    [email]csnm@samplingtechnologies.com[/email]
    Office: 902 450 5500
    Cell: 902 430 8498
    Fax:: 902 484 7115


    -----Original Message-----
    From: CPT John W. Holmes [mailto:holmes072000@charter.net]
    Sent: August 19, 2003 5:11 PM
    To: [email]csnm@samplingtechnologies.com[/email]; [email]php-general@lists.php.net[/email]
    Subject: Re: [PHP] deleting session variables

    From: "Tim Winters" <csnm@samplingtechnologies.com>
    > Is there a way to wipe out all previous session variables with one
    > command?
    With register_globals OFF:

    $_SESSION = array();

    If register_globals is ON and you want to get rid of $val1, $val2,
    $val3,
    etc... then:

    foreach($_SESSION as $key => $value)
    { unset($$key); }

    ---John Holmes...

    Tim Winters Guest

  5. #4

    Default Re: [PHP] deleting session variables

    * Thus wrote Tim Winters (csnm@samplingtechnologies.com):
    > Thanks,
    >
    > So what does session_unset() do then?
    John overlooked that function, and instead looped through the
    variables in php instead. This would be used if you have
    register_globals on and choose to use sessions insecurely.
    >
    > -----Original Message-----
    > From: CPT John W. Holmes [mailto:holmes072000@charter.net]
    > Sent: August 19, 2003 5:11 PM
    > To: [email]csnm@samplingtechnologies.com[/email]; [email]php-general@lists.php.net[/email]
    > Subject: Re: [PHP] deleting session variables
    >
    >
    > If register_globals is ON and you want to get rid of $val1, $val2,
    > $val3,
    > etc... then:
    >
    > foreach($_SESSION as $key => $value)
    > { unset($$key); }
    >
    Curt
    --
    "I used to think I was indecisive, but now I'm not so sure."
    Curt Zirzow Guest

  6. #5

    Default Re: [PHP] deleting session variables

    From: "Tim Winters" <csnm@samplingtechnologies.com>
    > So what does session_unset() do then?
    Ah, good catch. Use that instead of my second example. If register_globals
    is ON, it appears that session_unset() will take care of getting rid of the
    global variables made.

    ---John Holmes...
    > From: CPT John W. Holmes [mailto:holmes072000@charter.net]
    > Sent: August 19, 2003 5:11 PM
    > To: [email]csnm@samplingtechnologies.com[/email]; [email]php-general@lists.php.net[/email]
    > Subject: Re: [PHP] deleting session variables
    >
    > From: "Tim Winters" <csnm@samplingtechnologies.com>
    > > Is there a way to wipe out all previous session variables with one
    > > command?
    >
    > With register_globals OFF:
    >
    > $_SESSION = array();
    >
    > If register_globals is ON and you want to get rid of $val1, $val2,
    > $val3,
    > etc... then:
    >
    > foreach($_SESSION as $key => $value)
    > { unset($$key); }
    >
    > ---John Holmes...
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >
    Cpt John W. Holmes Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139