Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My Local httpd Apache 2.2 test server with php installed is having problems with a ipad user.

I have scripted a loggin script that uses php sessions to keep them loggedin, the page has a javascript that reloads an iframe and its php checks if the user is still loggedin or not. The problem is when my webhotel is running the the page it works perfecly but when im running the page om my local server it works perfecly on every computer or smartphone even iphone but not on a ipad. it keeps logging the ipad out after random time. and the header info is almost the same between my local server and the webhosting co server. Another note is that the ipad and all other wifi browsers are not in the lan domain and they can't surf to the localserver by name it have to use the ip adress. Another note is if you think i should post my conf and php.ini file or parts of it? i can do that.

The webhotel header: Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection:close Content-Type:text/html Date:Mon, 19 Nov 2012 09:15:06 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Pragma:no-cache Server:Apache Transfer-Encoding:Identity X-Powered-By:PHP/5.3.17

The local server header: Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection:Keep-Alive Content-Length:450 Content-Type:text/html; charset=iso-8859-1 Date:Mon, 19 Nov 2012 09:16:59 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Keep-Alive:timeout=5, max=76 Pragma:no-cache Server:Apache/2.2.22 (Win32) PHP/5.2.17 X-Powered-By:PHP/5.2.17

any idea of what the problem might be?

share|improve this question
add comment

1 Answer

It is possible that you have hard-coded references to the hostname that are still present when you connect via IP address?

My guess is that when you are connecting on the iPad to the site via IP address you are breaking the Same Origin Policy.

share|improve this answer
    
Thx for taking the time and answer my question, iam testing out ways to relax the Same Origin Policy by java script as we speak. i will let you all know if this solves it. –  Björn Nov 20 '12 at 12:44
    
It didn't solve the problem! now the domain is the same over the page and the iframe and not breaking the Same Origin Policy... but still the user on the ipad is logged out after 1-2h time with random intervals. I have under 3weeks time been trying to solve this. –  Björn Nov 20 '12 at 15:30
    
Have you tried running iOS Simulator (comes with XCode). This would allow you to test from a simulated iPad both on and off the LAN. –  AllInOne Nov 20 '12 at 19:23
    
The problem is, it helps to relax the same origin policy but a irritating setting of some sort is creating a connection close after 100 requests in the header and that with the garbage collector 1:1000 in php session removes the session cookie and logges the user out. I have bypassed it by useing somewhat less secure encrypted raw cookie that the garbage collector do not remove... The simulator was usefull in many ways but in the simulated world the simulated iPad is not automaticly logged out... –  Björn Dec 3 '12 at 8:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.