Ads Posted August 29, 2010 Share Posted August 29, 2010 I have a Login Script with a Remember me Function. The Script works flawlessly on my local server but when I upload it doesn't work on my web server. From what I can tell its a Session issue, When I log in, I make a session with the user ID, in which is used to pull all there information on other pages. On my local host it makes the sessions and everything is dandy, but on the web server it doesn't seem to make the session. Can anyone shed any light on this, I'm clueless once again Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/ Share on other sites More sharing options...
litebearer Posted August 29, 2010 Share Posted August 29, 2010 have you checked the php info on server to ascertain that sessions are enabled? Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/#findComment-1104846 Share on other sites More sharing options...
PFMaBiSmAd Posted August 29, 2010 Share Posted August 29, 2010 It's likely that your localhost/development system has output_buffering turned on in your master php.ini and so allowed you to crate code that would not work on the greatest number of web hosts where you might not have the ability to turn on output_buffering. If output_buffering is turned ON on your localhost, I recommend turning it off and getting your code to work again on your localhost before putting it onto your web host. Another common problem is that not all the settings needed for sessions are setup correctly on your web host (typically the session.save_path is not set to a valid folder.) Temporarily add the following lines of code immediately after your first opening <?php tag and before any php code in your main file to see if there are any errors when session_start() is called - ini_set("display_startup_errors", "1"); ini_set("display_errors", "1"); error_reporting(E_ALL); Is this the first time you have attempted to use code on your web host that uses sessions or does other code that uses sessions work and it is only your current code you tried that does not work? Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/#findComment-1104853 Share on other sites More sharing options...
Ads Posted August 29, 2010 Author Share Posted August 29, 2010 Its only since I added the Remember Me Feature and altered the Log in string that it has had an issue with Sessions. I did have output_buffering turned on, after turning it off, and running the code locally, it still works but takes a lot longer to load, not sure if that is a sign of anything. I added that code in, and it didn't seem to show anything up. Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/#findComment-1104856 Share on other sites More sharing options...
PFMaBiSmAd Posted August 29, 2010 Share Posted August 29, 2010 altered the Log in string W H A T Log in string? If that statement refers to a query, it's likely your queries are failing because of different database structures and you don't have any/enough error checking in your database code to get it to tell you if or why it is failing. Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/#findComment-1104859 Share on other sites More sharing options...
Ads Posted August 29, 2010 Author Share Posted August 29, 2010 >.< I meant Script Sorry, not string. Apparently I fail at spelling. I have however checked all my Database links and they are all working as they should be. Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/#findComment-1104860 Share on other sites More sharing options...
PFMaBiSmAd Posted August 29, 2010 Share Posted August 29, 2010 Frankly, you are gong to have to debug what your code IS doing on your web host to pin down at what point during it's execuition you have the expected results and at what point you don't. I can guarantee that the problem lies between those two points. You have not provide enough information about the actual symptoms, the code responsible for those symptoms, and at what step while navigating through your pages that the problem occurs at for anyone here to directly help. Quote Link to comment https://forums.phpfreaks.com/topic/212001-localhost-v-webserver-issue/#findComment-1104864 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.