Jump to content
danutz0501

Session

Recommended Posts

Posted

Salut am si eu o intrebare. Cum pot proteja sesiunile si sa ma feresc de csrf


/**
* setare sesiuni-folosire cookie,httponly,no get sau post
*/
ini_set('session.use_trans_sid', 0);
ini_set('session.cookie_secure',1);
ini_set('session.cookie_httponly',1);
ini_set('session.use_only_cookies',1);
/**
* pornire sesiuni
* verificare daca sant setate server side
*/
session_start();
if(!isset($_SESSION['SERVER_GENERATED_SID'])) {
session_destroy();
}
session_regenerate_id( );
$_SESSION['SERVER_GENERATED_SID']=true;

Momentan folosesc setarile de mai sus, si pt csrf un md5(uniqueid()).E bine ce fac, e egal cu zero adica zero protectie , e loc de mai bine?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...