Start a secure session


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function startSession() {
  2. $ok = @session_start();
  3. if(!$ok){
  4. session_regenerate_id(true); // replace the Session ID
  5. session_start(); // restart the session (since previous start failed)
  6. }
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.