Hi session lost while redirecting php

Hi session lost while redirect to another page in samsung galaxy nexus native browser only. in normal firefox ,ie ,chrome doesnt behave like that. why this strange behavior happens in the native browser. is anyone knows ?


Check if in the user browser prefrences if the security settings have ‘Remember Data’ unchecked or something similar. This sounds like a security override for the phone as it is probably blocking cookies being saved. So again anything related to cookie security check and see if allowed cookies is disabled.

I don’t have this phone so I am not sure, but this sounds like what might be causing this.


i can save cookies ,but session only lost when the page get redirected to another page.

For the mobile code in your site do you ever issue a destroy or unset $_SESSION? Sometimes the destroy sessions are accidentally left in a script when testing? I would also verify that the mobile device does not have cookies turned off or are blocking them and your page follows under the blocking criteria. I still suspect this is a mobile configuration issue as it does not work the same way for non-mobile devices right?

For the mobile version did you accidentally miss session_start or logical branching by-passes the session_start for the mobile?

Are you storing a high volume of data say 64Mb or more in the mobile Session. This can cause problems.

Check if you are using session_write_close(); anywhere. If you issue this and then sometime later try to write to the session it won’t have anything to write to and will fail.

I have also seen problems where deleting a session key by using unset($_SESSIOON[‘key’]); will cause the session not to save any more data, look for points in your code where you might do this and try setting the key to null instead, then try and see if it makes a difference?
Check your session cookie path in Firebug.

One other thing is to see if you host is running a cache like automatically cashing results could lead to this sort of behaviour.

Check the path were your sessions are being created and see if any session is actually getting created when using the phone.

use phpinfo() and check the settings for SESSION.

In the phpinfo() is the session.save_path valid, and does your server have write access to this directory?

You also should check the group and owner of the folder where the scripts run. If these are set differently that what apache is set to, i.e. the group id or user id are wrong it will cause sessions to nob be saved properly.

Also check the setting for session.cookie_secure. If it is set to ON then cookies will only be sent over a secure connection. If going on an insecure connection the cookie may be created but not found so php will create a new session every time, which also mean session variables will always be reset.

When you use the phone can also add var_dump($_SESSION); just after you start the session in the mobile page and then again on the next page to keep track of its’ content.


thank you for your suggestions, In samsung galaxy nexus browser it didnt accept the expiration period less than 6 hours. so i give more than that it works! any one know why the it need more expiration time ?