Monday 15 September 2014

Is it Security Safe to Destroy and unset a session like this in php -


Is security safe to destroy and unset a session like this? And does it follow the coding standard?

I am implementing an logout script for a website and the user successfully logs in the session session_name ("website_sess") Session_start (); After setting it

it is called a user that clicks on the logout button

  if ((isset ($ _ session [ 'First session'])) & amp; amp; amp; and; (empty ($ _ session ['first session'])) {$ _SESSION ['first session'] = '';} if ((( $ _ Session ['secondary name'])) & amp; amp; amp; amp; amp; amp; amp; amp; (($ _ session ['second name'] }} {$ _SESSION ['name of secondary'] = '';} if ((isset ($ _ session ['name of third session'])) & amp; amp; amp; amp; amp; Amp; amp; (empty ($ _ session ['third version name]]]) {$ _SESSION [' Name of the third session '] =' ';} If ((isset ($ _ session [' name of fourth session '])) & amp; amp; amp; amp; amp; amp; amp; amp; amp; ($ _ Session ['fourth session name']) {$ _SESSION ['fourth session'] = '';} session_name ("website_sess"); session_start (); session_unset (); $ _SESSION [] = Array (); session_destroy (); session_regenerate_id (TRUE);   

Is this security secure, and should be session_regenerate_id (TRUE)? After destroying all the sessions. @Keyak said in the form of

"What is it beyond your reach?" Take a look at the parameters section.

  & lt ?? Generate Php // a new session ID and delete old data as long as we are on session_regenerate_id (true);    

No comments:

Post a Comment