Jump to content

Setting cookies for 2 different domain extensions


trafix

Recommended Posts

Hi there,

Need help! ....

I have 2 domains 

xxxx.com
xxxx.com.au is parked in the above server.

when a user logs into one of them i need to be able to set the cookie(s) so the user is logged into both.

Currently if they log into one and go the the other extension, they are not logged in and it is driving my members batty .....

Can you assist me?

Trafix
Link to comment
Share on other sites

If i have 2 sites on different servers or with different extensions -- I generally don't set the domain...  This way there is no chance of coding error...

Another option you could have is to just add another cookie for the other domain by setting it at login, deleting it at logout, etc.. and basically just doing the same thing twice for every instance of calling the cookie...  Either way -- its your choice.. 
Link to comment
Share on other sites

i changed th code to ............

[code]
$lognameaa=strtolower($logname);
$userinfoaa[username]=strtolower($userinfo[username]);

        if ($lognameaa==$userinfoaa[username])
        {
            if ($logpass==$userinfo[password])
            {
                $exptime=time()+60*60*24*3;
                setcookie("usercookie",$logname,$exptime);
                setcookie("passcookie",$logpass,$exptime);
                header ("Location: index.php");
            }
            else
            {
            }
        }
        else
        {
        }
[/code]

no change ... logs in on one domain but not the other
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.