[)OBER]V[AN Posted May 26, 2006 Share Posted May 26, 2006 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'tIn Opera it some how disappears [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/ Share on other sites More sharing options...
gerkintrigg Posted May 26, 2006 Share Posted May 26, 2006 have you tried changing the ammount of time it's set by?for example set it in seconds??Try the tutorials to find out how...Then again i never use opera. Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-39224 Share on other sites More sharing options...
[)OBER]V[AN Posted May 26, 2006 Author Share Posted May 26, 2006 the strange thing when i try to display in in IE:Array( [user_id] => 1)it works.....but Opera:Array()cookie is gone :( Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-39225 Share on other sites More sharing options...
.josh Posted May 26, 2006 Share Posted May 26, 2006 maybe you have your opera browser settings set to not accept cookies. Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-39231 Share on other sites More sharing options...
[)OBER]V[AN Posted May 27, 2006 Author Share Posted May 27, 2006 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\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-39402 Share on other sites More sharing options...
[)OBER]V[AN Posted May 30, 2006 Author Share Posted May 30, 2006 So... will iget any help? Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-40206 Share on other sites More sharing options...
[)OBER]V[AN Posted June 29, 2006 Author Share Posted June 29, 2006 can anyone help me with this???? please????? Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-50836 Share on other sites More sharing options...
wildteen88 Posted June 29, 2006 Share Posted June 29, 2006 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 -> CookiesThats the only thing I ahve come up as to why Opera is deleting the cookie. Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-50881 Share on other sites More sharing options...
[)OBER]V[AN Posted June 29, 2006 Author Share Posted June 29, 2006 The setting is ok....I don't know why i have this problem and it's pissing me off. Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-50931 Share on other sites More sharing options...
wildteen88 Posted June 29, 2006 Share Posted June 29, 2006 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 setif(!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] Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-50940 Share on other sites More sharing options...
[)OBER]V[AN Posted July 14, 2006 Author Share Posted July 14, 2006 wildteen88 make one page with this code:[code]<?php// check that cookie hasnt been setif(!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 setif(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 Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-57964 Share on other sites More sharing options...
wildteen88 Posted July 14, 2006 Share Posted July 14, 2006 Did what you said and it works fine for me. Cookie is still set.EDIT: Heres a [url=http://homepage.ntlworld.com/cshepwood/cookie_opera2.wmv]short video[/url] Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-57969 Share on other sites More sharing options...
[)OBER]V[AN Posted July 14, 2006 Author Share Posted July 14, 2006 I found the problem....Opera doesn't save cookies from local files, when i uploaded the files to a host, the cookie worked... :-\ i wish it would work on local files too Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-58085 Share on other sites More sharing options...
wildteen88 Posted July 14, 2006 Share Posted July 14, 2006 It does work with local files. Look at the attached video, you'll see the files are being served locally. Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-58099 Share on other sites More sharing options...
[)OBER]V[AN Posted July 14, 2006 Author Share Posted July 14, 2006 yeah but mine some how doesn't work ??? Quote Link to comment https://forums.phpfreaks.com/topic/10517-problem-with-cookies/#findComment-58101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.