Carnacior Posted September 3, 2009 Share Posted September 3, 2009 At least for me. Let me explain the story. After 2 days of thinking and debugging i still got no fix. The problem is like this: I got some data saved in cookie and database too. User login is done with session. And i got session_start(); somwhere in the first lines for the user online checking and updateing. I have noticed that if the session_start(); is there my cookie['position']; or user['position']; variable are total different. I don`t even know from where the heck he gets those data. because in the file are only 1 included file for mysql connection and that`s it before those variables. If i remove the session_start(); the cookie works just fine. Has the real value. But the one from the database its not working because of the missing session_start(); Does someone know the problem ? sorry for my bad english. if you don`t understand something ask and i try to explain better. thanks in advice. ( and to mention i tryed to close the session before variables with session write close or session unregister or destroy but no results ) Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/ Share on other sites More sharing options...
play_ Posted September 3, 2009 Share Posted September 3, 2009 This happened to me once, but it was with $_POST and $_SESSION. don't remember which but one would be replaced with values from the other. try giving it another name and see what happens example: cookie['position'] and user['user_position'] Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/#findComment-911431 Share on other sites More sharing options...
Carnacior Posted September 3, 2009 Author Share Posted September 3, 2009 they are different i just posted like that for example . originally its: $_COOKIE['mylayout']; and $user['position']; a and the session is $_SESSION['ht_mem'];. If i test my website on localhost its working and when i upload to a server goes wrong. Im screwed cant fix it. Need bad help. Thanks! Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/#findComment-911445 Share on other sites More sharing options...
play_ Posted September 3, 2009 Share Posted September 3, 2009 I don't know Turn register_globals off if theyre not already. Look at phpinfo() on both the remote machine and the local one, and see which settings are different that could be causing it to happen =( Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/#findComment-912030 Share on other sites More sharing options...
Carnacior Posted September 3, 2009 Author Share Posted September 3, 2009 Tested with a friend on my localhost. And it does the same for him. I don`t get it. What other solutions can i try ? Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/#findComment-912083 Share on other sites More sharing options...
Carnacior Posted September 4, 2009 Author Share Posted September 4, 2009 Ok. I slowly figured out. Its something with CACHE. If i delete cache the variables are ok after refresh I just need a way to fix that cache. Disable it somehow. Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/#findComment-912123 Share on other sites More sharing options...
Carnacior Posted September 4, 2009 Author Share Posted September 4, 2009 Problem fixed. Disabled the cache Thanks all! Link to comment https://forums.phpfreaks.com/topic/172917-solved-weird-problem/#findComment-912133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.