Jump to content

Problem updating Cookie on live host


KingdomX

Recommended Posts

This works fine on localhost, but the same code just won't update my live website cookie. Here's the code:

 

 

index.php

 

$lg->updateCookies($username, $hashSalt[0]);

 

 

updateCookies function:

 

    $site = '.ciadacapa.com.br';

    // ---------------------------------------------------
    // Updates the cookies
    // ---------------------------------------------------
    function updateCookies($username, $hash){
        setcookie('ciadacapaUser', '', time()-3600, '/', $this->site);
        setcookie('ciadacapaHash', '', time()-3600, '/', $this->site);
        setcookie('ciadacapaUser', $username, time()+3600*24*7, '/', $this->site);
        setcookie('ciadacapaHash', $hash, time()+3600*24*7, '/', $this->site);
        
        return true;
    }

 

 

Although the class is receiving the correct values, the cookie just retains the old value it had and never updates. Any ideas on this?  :wtf:

 

Thanks in advance!

Link to comment
Share on other sites

That shouldn't be the problem, but i changed and tested it and it didn't work. I attached an image with the problem... the new is what it should be updated with.

 

What i'm trying to do is update the cookie Hash every page so that the old hashes are invalidated for security purposes. Again, works fine on localhost, but it just doesn't updates the value on live website.

 

Any more ideas i could try?  :shrug:

post-107743-13482403130882_thumb.jpg

Link to comment
Share on other sites

The dot . was there for a specific purpose (it makes the cookie match all sub-domains of the domain.)

 

Do you have php's error_reporting set to E_ALL and either display_errors set to ON or log_errors set to ON for your live server so that php would report and display or log all the errors it detects?

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.