Closed Thread
Results 1 to 8 of 8

Thread: Weird behaviour of session variables

  1. #1
    javiroquai2561 is offline x10Hosting Member javiroquai2561 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    10

    Weird behaviour of session variables

    Hello.
    I'm developing a little web app with a login system, and uses some $_SESSION variables. I tested my code using XAMPP on my PC, and it works fine.
    But when I upload the files on x10hosting, the pages started to behave randomly respect session variables (sometimes you login, then you appear not logged, but if refresh or go to another 'not-logged' page, you are logged in again...)

    I've tried everything:

    - .htaccess file with SetEnv session.use_cookies='0'; and SetEnv session.use_cookies='1';
    - using the following in my php code:
    ini_set('register_globals', 0); and ini_set('register_globals', 1);
    ini_set('session.use_cookies', '0'); and ini_set('session.use_cookies', '1');
    header("Cache-Control: no-cache");
    session_set_cookie_params(10);... and 30 and 60 and 3600 and 0...

    But the strange behaviour continues to happen...
    I don't know what to do, i'm going crazy with this stuff.
    What do you think could be causing that behaviour? Why it works on my PC?

    A related question: How could I check the PHPInfo and/or Apache server values? I don't find links to check that stuff on cPanel...

  2. #2
    masshuu's Avatar
    masshuu is offline Head of the Geese masshuu has a spectacular aura about
    Join Date
    Oct 2007
    Location
    Las Colinas, Tx
    Posts
    2,262

    Re: Weird behaviour of session variables

    I looked and i do see this issue. I can't offer any tips or help. As this forum is for issues with your hosting account, you may not get a proper answer here.
    Just leading the flock.
    Livewire
    Masshuu ------ carl6969
    descalzo ------------------- Smith6612
    Bryon--------------------------------- Corey
    If you find any post helpful or useful, duck
    \ / This for that post and rep it up.

  3. #3
    javiroquai2561 is offline x10Hosting Member javiroquai2561 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    10

    Re: Weird behaviour of session variables

    Well, thanks for your reply. In any case, I think it is related to the account settings. I just tested the files on another hosting, and there it works perfect.

    Here at x10hosting the app is loosing session variables at random...

    I just signed here because i needed sendmail active. I need curl, sendmail and cronjobs active to have it working fine. These three ingredients work fine here, but the php $_SESSION (basic stuff i think) don't work AT ALL!

    Do anyone know any other free web hosting with curl, sendmail, cronjobs... and where PHP SESSIONS work just fine?

    Thanks.

    ---------- Post added at 02:30 PM ---------- Previous post was at 01:44 PM ----------

    I just tried another thing:

    introduced php_value register_globals off on the .htaccess file, and when I do that, the site prompts 500 Internal error, so I think I can not change it, and I think this feature is ON?

    You have to be kidding:
    http://php.net/manual/en/security.globals.php

  4. #4
    calistoy's Avatar
    calistoy is offline Free Support Volunteer calistoy is just really nice
    Join Date
    Aug 2008
    Location
    USA
    Posts
    5,598

    Re: Weird behaviour of session variables

    register_globals is always set to off because it's a huge security risk. What makes you think it was on? You can't change any php settings in your account because those are set server wide and can't be reached at all by anyone who isn't hired staff at x10hosting.

    By the way, you might get better help if you post this problem in http://x10hosting.com/forums/programming-help/.
    Last edited by calistoy; 02-15-2011 at 08:46 AM.

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Weird behaviour of session variables

    This has nothing to do with programming.

    When x10hosting switched to a load balancing set up, PHP sessions became unreliable. If you are pointed at one server, the session is saved there. If your next request is routed to another server, it cannot find your session.

    Not sure if they use round robin, which would totally bork sessions, or IP based, which would tend to work but with occasional hiccups.
    Nothing is always absolutely so.

  6. #6
    javiroquai2561 is offline x10Hosting Member javiroquai2561 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    10

    Re: Weird behaviour of session variables

    What?

    They do that???

    So there is nothing I could do to get sessions working fine???

    But this way how can they manage any kind of web app??

    If you can't manage sessions in a reliable way you are screwed!... I don't get it.

    Anyway, the information they provide about the hosting settings is less than enough... phpinfo is disabled, and this way you don't know if you have register_globals enabled or not, if you use cookies or not, if you have magic quotes or not....

    The problem for me is that I don't find a web hosting with all my requirements, there is always one that is lost...

    Maybe x10hosting is only useful for emailing forgotten passwords?

  7. #7
    calistoy's Avatar
    calistoy is offline Free Support Volunteer calistoy is just really nice
    Join Date
    Aug 2008
    Location
    USA
    Posts
    5,598

    Re: Weird behaviour of session variables

    Quote Originally Posted by javiroquai2561 View Post
    The problem for me is that I don't find a web hosting with all my requirements, there is always one that is lost...
    If you have requirements and don't know if they are present here, then please go ahead and ask us here.

  8. #8
    javiroquai2561 is offline x10Hosting Member javiroquai2561 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    10

    Re: Weird behaviour of session variables

    x10Hosting has everything I need: Sendmail really active (other hostings say it is ON, but the mails never arrive), cronjobs, curl and that's all. I don't need a lot of space or bandwith, but also I would like to know what are the settings respect use_cookies, register_globals and magic_quotes (I hope these 3 settings being OFF).

    The only problem I have here is the strange behaviour of the session variables. I know I'm doing everything right, because it works on my PC and into another hosting (but this one doesn't allow sendmail or cronjobs... but at least they TELL you what the features are, and also phpinfo is available from admin panel) If the behaviour is caused by the switching of the servers anytime you access a page, this is really pretty BAD! (and I can't do anything to solve it).

    On the other side, it is not strange that a lot of people on free accounts abused using phpinfo()... If x10hosting doesn't provide any other method to know about the free accounts settings (for example, listing the most important settings on a text file or bullet list on a web page or SOMETHING), that's the way all people would try to get them...

    ---------- Post added at 04:03 PM ---------- Previous post was at 09:11 AM ----------

    WTF?

    The account was automatically suspended because of high use of resources!! (I think that a cronjob launching a little php script that reads just some urls and updates the database every 30 minutes can not be called "high use of resources", but anyway...)

    I reactivated it again just to backup the database, and it's taking AGES to get the sql file...

    --------------

    ... After half an hour, I get the file, and there it is the problem: A user called "M8R-1x46xp@mailinator.com" registered on my app??



    ---------- Post added at 04:42 PM ---------- Previous post was at 04:03 PM ----------

    OK.

    I was suspended another time while trying to understand just what happened before... So I've deleted all my files, i'll remove the MySQL database (i've started to do it, but it takes millennia for the tables just to appear...), and finally remove my account...

    If I can not do it (I'll try after writting this post) COULD ANYONE PLEASE, REMOVE MY ACCOUNT???

    And by the way... x10Hosting is probably the worst free hosting i've ever met.

    Thanks for your <IRONIC MODE>support</IRONIC MODE> (this goes for the staff, not for the community)
    Last edited by javiroquai2561; 02-16-2011 at 03:13 AM.

Closed Thread

Similar Threads

  1. Are Session Variables Vulnerable
    By tillabong in forum Programming Help
    Replies: 5
    Last Post: 04-14-2010, 10:06 AM
  2. file_get_contents with url - weird behaviour
    By Sweet Charity in forum Free Hosting
    Replies: 1
    Last Post: 05-07-2009, 12:24 PM
  3. Quick question: session variables and functions (PHP)
    By Salvatos in forum Programming Help
    Replies: 2
    Last Post: 10-08-2008, 11:55 PM
  4. Session variables are not transferring.
    By Genius_boy001 in forum Free Hosting
    Replies: 4
    Last Post: 12-06-2007, 08:05 AM
  5. Session variables not working
    By os242 in forum Scripts & 3rd Party Apps
    Replies: 12
    Last Post: 10-19-2007, 05:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers