Jump to content

Cookies on include files.


turkman

Recommended Posts

didn't work.  still on one page its the new cookie, go to a different page and displays old cookie.

 

try yourself i have debugging on. supercookie is what you are looking for.

 

go to the site it will create a cookie.

go to stuff, log out

you will be redirected to main page and have a new cookie

click on post, bulletins, faq and you will have old cookie back

 

www.imgboard.co.uk

Link to comment
Share on other sites

Hey OP, just saying:

 

Rule #13: Duplication of topics is strictly prohibited. Users will not post duplicate topics, if a topic needs moved please use the "Report to Moderator" button and a staff member will move the topic as soon as possible.

(http://www.phpfreaks.com/forums/index.php/topic,310296.0.html)

 

Also, trying to post out all the meaningful bits of code helps - for example the log out bit, both places where you set cookies, etc.

Link to comment
Share on other sites

the other thread didn't make sense. Thought this was more clear. Its just stupid problems now. I can log in and override the existing cookie and get a new one. But using basically the same function i CANNOT get it to change.

 

This bit works, if i have a cookie and log in. It will override the cookie.

 

  if($p==$row['pass']){ 
        
        $n = $row['uname'];
        $_SESSION['uname'] =$row['uname'];
        $_SESSION['ID']= $row['ID'];
         $_SESSION['LEVEL'] = $row['level'];  
         $_SESSION['lv'] = $row['lv'];  
           
         
         setcookie("supercookie",$row['scookie'],time() + 60 *60 *24 *30);
         $cc = $row['scookie'];
         
         
        
        unset($_SESSION['lf']);
        echo "<script>location.href='http://www.imgboard.co.uk'</script>.";
        header("Location: http://www.imgboard.co.uk");

 

 

this bit doesnt work, despite being just below the above code in the file.

 


else if(isset($_GET['logout'])){
    
   
       
        
        
        unset($_SESSION['uname']);
        unset($_SESSION['ID']);
         unset($_SESSION['LEVEL']) ;
         unset($_SESSION['lv']);
         $cr = $_COOKIE['supercookie'];
        setcookie("supercookie",$cr ,time() -3600);
       
       
        $charlist =  "abcdefghijklmnopqrstuvwxyz0123456789";
        $c = "";
        
        for($i = 0; $i < 25; $i++ ){
        
              
              $r = rand() % strlen($charlist);
              $c .= $charlist[$r];
        
        
        }
        
        setcookie("supercookie",$c,time() + 60 * 60 * 24 * 30);
        echo "<script>location.href='http://www.imgboard.co.uk'</script>.";
        header("Location: http://www.imgboard.co.uk");
    
    
    
    
    }

 

 

Its practically the same code! yet it doesn't work when i try to logout. However it works when i log in. So fukkn annoying.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.