Jump to content

Localhost .V. Webserver Issue


Ads

Recommended Posts

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 ^_^

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

 

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.