1
votes

I have two different codeigniter CMS for desktop and mobile versions of site. I use codeigniter user agent to detect mobile and redirect to mobile version. I have a link in mobile site to browse the desktop version as well. I used session and cookie separately, one by one in mobile cms and tried to get those values in desktop cms but it was different cms so not possible. How can I switch from mobile to desktop condition there codeigniter user agent is also enabled.

Any help appreciated

1

1 Answers

0
votes

Assuming that the two sites are under the same domain ( eg www.site.com and mobile.site.com ), you can have cookies that are available for both, by specifying their domain with a leading period ( ie .site.com ).

That way you can access the cookies from both sites, and if your cookies are the session cookies, you can have a common session as well.

For CodeIgniter, you can use the setting :

 $config['cookie_domain']    = ".site.com";