|
-
Jan 25th, 2006, 01:29 PM
#1
Thread Starter
Addicted Member
Session Confusion
I have looked into some codes about session management.
Sequense of session functions are something like that
Code:
session_start(); //starts session
session_unset();//remove all the data from the session
session_destroy();//remove the session itself
//and then
session_register(); //is called
I am confused about why session_destroy function is called before session_register function.
Thank You.
-
Jan 25th, 2006, 03:01 PM
#2
Re: Session Confusion
 Originally Posted by slice
I am confused about why session_destroy function is called before session_register function.
Thank You.
The only reason I can think fo would be to remove any pre-existing sessions or possible ones that may have been injected, those the only reasons I can think of.
Cheers,
Ryan Jones
-
Jan 26th, 2006, 02:35 AM
#3
Thread Starter
Addicted Member
Re: Session Confusion
But it would not nullify session_start() ?
-
Jan 26th, 2006, 07:08 AM
#4
Re: Session Confusion
It might, but session_register starts a session automatically if needed.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 26th, 2006, 10:36 AM
#5
Thread Starter
Addicted Member
Re: Session Confusion
 Originally Posted by CornedBee
It might, but session_register starts a session automatically if needed.
Then why coders use session_start() and then session_unset() following session_destroy() before session_register().
-
Jan 26th, 2006, 10:39 AM
#6
Re: Session Confusion
 Originally Posted by slice
Then why coder use session_start() and then session_unset() following session_destroy() before session_register().

Probably for some reason, I still think its to destroy any pre-existing sessions but its not really important to do it that way anyway...
Cheers,
Ryan Jones
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|