Weird behaviour of session variables

Status
Not open for further replies.

javiroquai2561

New Member
Messages
10
Reaction score
0
Points
0
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...
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
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.
 

javiroquai2561

New Member
Messages
10
Reaction score
0
Points
0
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
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
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:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
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.
 

javiroquai2561

New Member
Messages
10
Reaction score
0
Points
0
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?
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
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.
 

javiroquai2561

New Member
Messages
10
Reaction score
0
Points
0
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??

:eek:

---------- 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:
Status
Not open for further replies.
Top