I am trying to implement a mobile solution to a web app I am making for my company. The primary pc based app works perfectly well but the mobile piece is behaving strangely.
Currently, the only way for a user to log out is for them to access the app main page and select logout (this will change eventually but we are still in early dev). When a user logs out of the app, I call a controller (index.php) that will flush the PHP session data, create a page (form.html.php) where the user can then click a link to log back in. This link will call the main controller which will check to see if specific session variables are set and if not, redirect to the login controller/page. Since the logout form flushes all of that data, the user should be redirected to the login page. As stated before, using a PC browser, this works fine.
What is happening on the mobile piece is that when the user clicks on the link to log back in, the mobile device goes to the main page where the logged out from. Since all session data is inactive, the page is effectively dead.
How can I get the Mobile app (or JQuery mobile) to stop caching the previous page? Any help is appreciated. FYI: I am just learning the mobile app infrastructure.
index.php:
<?php
session_start();
$url = $_SESSION['myurl'];
$root = $_SESSION['myroot'];
$formTitle = 'Exit NSI CRM';
$formHeading = 'NSI CRM System - Goodbye';
$m = $_SESSION['mobile'];
session_destroy();
($m?include ('m_form.html.php'):include ('form.html.php'));
exit();
?>
m_form.html.php:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="<?php print 'http://'.$_SERVER['HTTP_HOST'].'/crm/css/m_crm.css';?>">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script type="text/javascript">
google.load("jquery", "1");
</script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<?php include $root.'/inc/favicon.php'; ?>
<title><?php print $formTitle; ?></title>
</head>
<body>
<div data-role="page">
<div>
<br>
<img src="<?php print 'http://'.$_SERVER['HTTP_HOST'].'/crm/img/handshake.jpg';?>">
<h3>
You have been logged out of the NSI CRM System. Good-bye!
<br>
To log back in, click <a style="font-size: larger;" href="<?php echo 'http://'.$_SERVER['HTTP_HOST'].'/crm/'; ?>">here.</a>
</h3>
</div>
</div><!-- /page -->
</body>
</html>
Have you tried disabling the ajax functionality of jquery mobile?
call this before the jquery mobile framework loads.
or you could modify your link back adding one of these attributes
e.g.
<a href="somepage.html" rel="external">Link</a>reference: http://jquerymobile.com/demos/1.0a4.1/docs/pages/link-formats.html