Show
Ignore:
Timestamp:
03/14/06 08:15:12 (3 years ago)
Author:
gerd
Message:

fixed some session restart hazards

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/patSession2/examples/example_secure_fork.php

    r40 r43  
    2222        // get old session id 
    2323        $oldId  =       $sess->getId(); 
    24          
    25         // fork session 
    26         $sess->fork(); 
     24 
     25    if( isset( $_GET['fork'] ) && $_GET['fork'] == 'yes' ) {     
     26        // fork session 
     27        $sess->fork(); 
     28    } 
    2729?> 
    28 <form action="<?PHP echo $_SERVER['PHP_SELF'] . '?' . $sess->getQueryString();  ?>" method="POST"> 
     30<form action="<?PHP echo $_SERVER['PHP_SELF'] . '?' . $sess->SID;  ?>" method="POST"> 
    2931Store custom value...<br /> 
    3032<table border="0" cellpadding="1" cellspacing="0"> 
     
    6163        echo '<b>new:</b> ' . $sess->getId() . "<br />\n"; 
    6264         
    63         $queryString    =       $sess->getQueryString()
     65        $queryString    =       $sess->SID
    6466 
    6567    echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a><br />'; 
     68    echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '&fork=yes" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'&fork=yes">Fork this session</a><br />'; 
    6669     
    67     if( isset( $_POST['submit'] ) ) 
    68     { 
     70    if( isset( $_POST['submit'] ) ) { 
    6971        $sess->set( $_POST['name'], $_POST['value'] ); 
    7072    } 
  • branches/patSession2/examples/example_secure_useToken.php

    r40 r43  
    2020        $options        =       array(   
    2121                                                        'security'              => 'use_token', 
    22                                                         'tokenmode'             => 'any', 
     22                                                        'token-mode'    => 'any', 
     23                            'token-name'    => 'mytoken', // for cookies only 
    2324                                                        'empty-referer' => 'allow' 
    2425                                                );