Jump to content

Problem With Cookies


[)OBER]V[AN

Recommended Posts

hi all, can anyone help me?
[code]setcookie('user_id',1,mktime(0, 0, 0, 12, 32, 2030)); [/code]

when i try to display the valeu of $_COOKIE['user_id']
in IE it works,
in Opera it doesn't

In Opera it some how disappears [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
Link to comment
Share on other sites

Browser settings is ok, it accepts cookies.
In opera it creats the cookie and it working wile the page is up, when i close opera and try to open it again the cookie is gone...
[img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
Link to comment
Share on other sites

  • 5 weeks later...
Make sure you dont have the setting "[i]Delete new cookies when exiting Opera[/i]" is ticked. You can check this by going to Tools -> Preferences Avanced Tab -> Cookies

Thats the only thing I ahve come up as to why Opera is deleting the cookie.
Link to comment
Share on other sites

Intresting! I have tried your script and it works fine for me. I have no idea what else might be the problem. This is the code I used:
[code]<?php

// check that cookie hasnt been set
if(!isset($_COOKIE['user_id']))
{
    // set the cookie
    setcookie('user_id',1,mktime(0, 0, 0, 12, 32, 2030));

    echo "Cookie has been set. Refresh the browser window";
}
else
{
    // get the cookie
    echo "Retrieving cookie...<br />\n";
    echo $_COOKIE['user_id'];
}

?>[/code]
Link to comment
Share on other sites

  • 2 weeks later...
wildteen88 make one page with this code:
[code]
<?php

// check that cookie hasnt been set
if(!isset($_COOKIE['user_id']))
{
    // set the cookie
    setcookie('user_id',1,mktime(0, 0, 0, 12, 32, 2030));

    echo "Cookie has been set. Refresh the browser window";
}
?>
[/code]
and enother page with this code:
[code]
<?php

// check that cookie hasnt been set
if(isset($_COOKIE['user_id']))
{
    // get the cookie
    echo "Retrieving cookie...<br />\n";
    echo $_COOKIE['user_id'];
}
?>
[/code]

do the folowing:
1) activate the first page.
2) go to the second page.
3) close the opera.
4) open the opera and open the second page ""WITHOUT THE FIRST ONE""!!!
5) do refresh and you will see that the cookie is not set any more
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.