logout script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pank

    logout script

    hey guys ...
    can anybody tell me a php logout script.
    I want to log out from one page which i was developing ,
    i tried but it's not working. I have tried
    session_destroy (),session_unse t() functions
    but they are not working.
    If any one is having that script then please help me .

  • Tyno Gendo

    #2
    Re: logout script

    pank wrote:
    hey guys ...
    can anybody tell me a php logout script.
    I want to log out from one page which i was developing ,
    i tried but it's not working. I have tried
    session_destroy (),session_unse t() functions
    but they are not working.
    If any one is having that script then please help me .
    >
    Session_destroy should destroy all variables you have set in $_SESSION

    Are you saying that the Session state is kept even after you close all
    browsers?

    Are you sure you're not using other cookies rather than Session data?

    Comment

    • Schraalhans Keukenmeester

      #3
      Re: logout script

      Tyno Gendo wrote:
      pank wrote:
      >hey guys ...
      > can anybody tell me a php logout script.
      >I want to log out from one page which i was developing ,
      >i tried but it's not working. I have tried
      >session_destro y(),session_uns et() functions
      >but they are not working.
      > If any one is having that script then please help me .
      >>
      >
      Session_destroy should destroy all variables you have set in $_SESSION
      >
      No it does NOT. They are valid as long as the script runs. A call to
      $_SESSIONS=arra y(); after the session_destroy () clears the session
      variables.

      Sh.

      Comment

      • FrobinRobin

        #4
        Re: logout script

        On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
        wrote:
        Tyno Gendo wrote:
        pank wrote:
        hey guys ...
        can anybody tell me a php logout script.
        I want to log out from one page which i was developing ,
        i tried but it's not working. I have tried
        session_destroy (),session_unse t() functions
        but they are not working.
        If any one is having that script then please help me .
        >
        Session_destroy should destroy all variables you have set in $_SESSION
        >
        No it does NOT. They are valid as long as the script runs. A call to
        $_SESSIONS=arra y(); after the session_destroy () clears the session
        variables.
        >
        Sh.
        Does it HAVE to be that way around? I usually do it the other way
        around: session_destroy then $_SESSIONS=arra y() and it works fine for
        me.

        If the original poster is doing this and still has problems; I would
        suggest checking the session name on your logged in pages and also the
        logging out page. Use the session_name() function to see this.
        Personally I always use a custom session name for `security` purposes.

        Comment

        • Schraalhans Keukenmeester

          #5
          Re: logout script

          FrobinRobin wrote:
          On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
          wrote:
          >Tyno Gendo wrote:
          >>pank wrote:
          >>>hey guys ...
          >>> can anybody tell me a php logout script.
          >>>I want to log out from one page which i was developing ,
          >>>i tried but it's not working. I have tried
          >>>session_dest roy(),session_u nset() functions
          >>>but they are not working.
          >>> If any one is having that script then please help me .
          >>Session_destr oy should destroy all variables you have set in $_SESSION
          >No it does NOT. They are valid as long as the script runs. A call to
          >$_SESSIONS=arr ay(); after the session_destroy () clears the session
          >variables.
          >>
          >Sh.
          >
          Does it HAVE to be that way around? I usually do it the other way
          around: session_destroy then $_SESSIONS=arra y() and it works fine for
          me.
          >
          If the original poster is doing this and still has problems; I would
          suggest checking the session name on your logged in pages and also the
          logging out page. Use the session_name() function to see this.
          Personally I always use a custom session name for `security` purposes.
          >
          I was a bit ambiguous in my phrasing. I use the same order you do.
          technically I don't think there's much against the other way around,
          from a logical point of view I think 'yours' is the preferred.

          Sh.

          Comment

          • Tyno Gendo

            #6
            Re: logout script

            Schraalhans Keukenmeester wrote:
            FrobinRobin wrote:
            >On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
            >wrote:
            >>Tyno Gendo wrote:
            >>>pank wrote:
            >>>>hey guys ...
            >>>> can anybody tell me a php logout script.
            >>>>I want to log out from one page which i was developing ,
            >>>>i tried but it's not working. I have tried
            >>>>session_des troy(),session_ unset() functions
            >>>>but they are not working.
            >>>> If any one is having that script then please help me .
            >>>Session_dest roy should destroy all variables you have set in $_SESSION
            >>No it does NOT. They are valid as long as the script runs. A call to
            >>$_SESSIONS=ar ray(); after the session_destroy () clears the session
            >>variables.
            Indeed. I've only ever used session_destroy () as the last statement
            before quitting the page, so I never noticed. Seems a bit crap, after
            all, you're asking it to 'destroy' the session, does anyone have a use
            for destroying it and _still_ retaining the variables until script end?

            Comment

            • Jerry Stuckle

              #7
              Re: logout script

              Tyno Gendo wrote:
              Schraalhans Keukenmeester wrote:
              >FrobinRobin wrote:
              >>On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
              >>wrote:
              >>>Tyno Gendo wrote:
              >>>>pank wrote:
              >>>>>hey guys ...
              >>>>> can anybody tell me a php logout script.
              >>>>>I want to log out from one page which i was developing ,
              >>>>>i tried but it's not working. I have tried
              >>>>>session_de stroy(),session _unset() functions
              >>>>>but they are not working.
              >>>>> If any one is having that script then please help me .
              >>>>Session_des troy should destroy all variables you have set in $_SESSION
              >>>No it does NOT. They are valid as long as the script runs. A call to
              >>>$_SESSIONS=a rray(); after the session_destroy () clears the session
              >>>variables.
              >
              Indeed. I've only ever used session_destroy () as the last statement
              before quitting the page, so I never noticed. Seems a bit crap, after
              all, you're asking it to 'destroy' the session, does anyone have a use
              for destroying it and _still_ retaining the variables until script end?
              I never destroy a session. Rather, I unset variables which are no
              longer needed. Destroying a session might make other pages start to fail
              because of session variables they use.

              And maybe the site doesn't have this potential problem now - but what
              about later? It's things like this which take hours (or days) to track
              down.

              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===

              Comment

              • Schraalhans Keukenmeester

                #8
                Re: logout script

                Jerry Stuckle wrote:
                Tyno Gendo wrote:
                >Schraalhans Keukenmeester wrote:
                >>FrobinRobin wrote:
                >>>On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@inva lid.spam>
                >>>wrote:
                >>>>Tyno Gendo wrote:
                >>>>>pank wrote:
                >>>>>>hey guys ...
                >>>>>> can anybody tell me a php logout script.
                >>>>>>I want to log out from one page which i was developing ,
                >>>>>>i tried but it's not working. I have tried
                >>>>>>session_d estroy(),sessio n_unset() functions
                >>>>>>but they are not working.
                >>>>>> If any one is having that script then please help me .
                >>>>>Session_de stroy should destroy all variables you have set in
                >>>>>$_SESSIO N
                >>>>No it does NOT. They are valid as long as the script runs. A call to
                >>>>$_SESSIONS= array(); after the session_destroy () clears the session
                >>>>variables .
                >>
                >Indeed. I've only ever used session_destroy () as the last statement
                >before quitting the page, so I never noticed. Seems a bit crap, after
                >all, you're asking it to 'destroy' the session, does anyone have a use
                >for destroying it and _still_ retaining the variables until script end?
                >
                I never destroy a session. Rather, I unset variables which are no
                longer needed. Destroying a session might make other pages start to fail
                because of session variables they use.
                >
                And maybe the site doesn't have this potential problem now - but what
                about later? It's things like this which take hours (or days) to track
                down.
                >
                <coughI wish I could say "I haven't got the faintest idea what you
                mean Jerry" </cough;-)

                Sh.

                Comment

                Working...