learning_brain
New Member
- Messages
- 206
- Reaction score
- 1
- Points
- 0
www.donbur.co.uk
This site has a php mobile detection script which activates a different architecture and css for mobile devices... nothing new there other than I'm not using the css selector statements.
When viewed on a mobile, you get an option to switch to normal full screen mode (classic view). This is simply a form which sends a $_GET variable back to the same page.
In addition, on every page, I also keep sessions.
So... if no session... start session
if isset($_GET['mobilepref']) then $_SESSION['mobilepref'] = $_GET['mobilepref'].... see where I'm headed?
So for every page visited afterwards, this session variable should be stored (mobilepref happens to be "fullscreen").
Therefore, if the detection script shows its a mobile and $_SESSION['mobilepref'] != "fullscreen" it will show the fullscreen version...
MY PROBLEM is that if you go to the index page for example on a mobile (tablet or otherwise), it seems to store the mobile layout in cache (or any other page you view first). If you then go to another page and then click (view classic), this works for that page, but if you return to the index page, it doesn't show the fullscreen version... ??? (unless you refresh)
How can I resolve this without having to force no-cache?
I don't particularly want to force a no-cache as there is quite a bit of content in the header/footer.
Any ideas?
This site has a php mobile detection script which activates a different architecture and css for mobile devices... nothing new there other than I'm not using the css selector statements.
When viewed on a mobile, you get an option to switch to normal full screen mode (classic view). This is simply a form which sends a $_GET variable back to the same page.
In addition, on every page, I also keep sessions.
So... if no session... start session
if isset($_GET['mobilepref']) then $_SESSION['mobilepref'] = $_GET['mobilepref'].... see where I'm headed?
So for every page visited afterwards, this session variable should be stored (mobilepref happens to be "fullscreen").
Therefore, if the detection script shows its a mobile and $_SESSION['mobilepref'] != "fullscreen" it will show the fullscreen version...
MY PROBLEM is that if you go to the index page for example on a mobile (tablet or otherwise), it seems to store the mobile layout in cache (or any other page you view first). If you then go to another page and then click (view classic), this works for that page, but if you return to the index page, it doesn't show the fullscreen version... ??? (unless you refresh)
How can I resolve this without having to force no-cache?
I don't particularly want to force a no-cache as there is quite a bit of content in the header/footer.
Any ideas?
Last edited: