Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 13th, 2007, 04:05 PM
pank
Guest
 
Posts: n/a
Default 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_unset() functions
but they are not working.
If any one is having that script then please help me .

  #2  
Old April 13th, 2007, 04:35 PM
Tyno Gendo
Guest
 
Posts: n/a
Default Re: logout script

pank wrote:
Quote:
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_unset() 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?

  #3  
Old April 13th, 2007, 08:55 PM
Schraalhans Keukenmeester
Guest
 
Posts: n/a
Default Re: logout script

Tyno Gendo wrote:
Quote:
pank wrote:
Quote:
>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_unset() 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=array(); after the session_destroy() clears the session
variables.

Sh.
  #4  
Old April 14th, 2007, 12:45 PM
FrobinRobin
Guest
 
Posts: n/a
Default Re: logout script

On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
wrote:
Quote:
Tyno Gendo wrote:
Quote:
pank wrote:
Quote:
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_unset() functions
but they are not working.
If any one is having that script then please help me .
>
Quote:
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=array(); 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=array() 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.

  #5  
Old April 14th, 2007, 01:45 PM
Schraalhans Keukenmeester
Guest
 
Posts: n/a
Default Re: logout script

FrobinRobin wrote:
Quote:
On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
wrote:
Quote:
>Tyno Gendo wrote:
Quote:
>>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_unset() 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=array(); 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=array() 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.
  #6  
Old April 15th, 2007, 11:45 AM
Tyno Gendo
Guest
 
Posts: n/a
Default Re: logout script

Schraalhans Keukenmeester wrote:
Quote:
FrobinRobin wrote:
Quote:
>On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
>wrote:
Quote:
>>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_unset() 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=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?
  #7  
Old April 15th, 2007, 02:45 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: logout script

Tyno Gendo wrote:
Quote:
Schraalhans Keukenmeester wrote:
Quote:
>FrobinRobin wrote:
Quote:
>>On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@invalid.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_unset() 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=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.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  #8  
Old April 15th, 2007, 10:25 PM
Schraalhans Keukenmeester
Guest
 
Posts: n/a
Default Re: logout script

Jerry Stuckle wrote:
Quote:
Tyno Gendo wrote:
Quote:
>Schraalhans Keukenmeester wrote:
Quote:
>>FrobinRobin wrote:
>>>On 13 Apr, 20:48, Schraalhans Keukenmeester <bitbuc...@invalid.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_unset() 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=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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles