Hi guys, I have a jquery mobile $session problem :
Some background : The system itself is a mix between CodeIgniter and PW - customer login, business logic calculations are done via CI; however some static pages are displayed via PW. CI sets $_SESSIONS on login, which are then used from processwire; furthermore PW API is used by CI to create new pages, add text images, etc. All of the above works fine on a desktop/tablet
The problem :
That's where jQuery mobile comes. To detect mobile devices I've used this logic inside site/config.php:
if( check_user_agent('mobile') ) {
$config->urls->templates = '/site-mobile/templates/';
$config->paths->templates = $rootPath . $config->urls->templates;
}
It all works good - I get redirected accordingly;
Sadly there is a but - On the mobile version after I (user) manually refresh the page or open another page the $session goes from this
array(6) {
["Session"]=>
array(0) {
}
["username"]=>
string(19) "my_email@gmail.com"
["firstname"]=>
string(5) "Boris"
["lastname"]=>
string(7) "Processwire"
["usertime"]=>
int(1406733793)
}
to nothing:
array(1) {
["Session"]=>
array(0) {
}
}
The original idea was for the mobile to sit on m.mysite.com ,but for cross domain requests, session and seo issues this is not an option.
What have I tried with jQuery Mobile so far :
disable ajax globally / page specifically
force full urls e.g. from /page to www.mysite.com/page
'a' tags data-ajax=false
pass sessions from $_SESSION to PW $session->varname - it goes empty on refresh
As mentioned it all works fine on the desktop version, so I'm pretty sure that has something to do with jQuery mobile. Any ideas. suggestions, notes, topics or anything on the subject is highly appreciated!
Please let me know if you want me to display more code samples.