How to remember what the user has chosen the desktop version and not trigger a mobile css?

Colleagues, a question.
There is a mobile version of the site, it is made using css (@media handheld and @media only screen and (max-device-width: 480px))

How more correctly to organize the transition to the desktop version? That the user clicked on the Desktop version, it loaded the desktop, and then clicking on the links — he also saw desktop.

As correctly it to make? Using get parameters, cookies and so on? You may already have a tried and tested solution in the industry. Don't want to reinvent the wheel.

Here the user went to a page with mobilki. Mobilka machine picked up the styles for mobile. Displays the mobile view.
The user wants to see the desktop version. Clicks on the link — and here we are, for example, via get-parameter overloaded this page and using php output such as a class any which does not give work mobile style or something else, doesn't matter.
How to remember what the user has chosen the desktop version and not trigger a mobile css?

After all, the link he clicks and he's back mobile work styles. Carry a get parameter? Cookies to write?
Surely there is some common solution.
October 8th 19 at 03:17
5 answers
October 8th 19 at 03:19
well, I don't think to attribute to EVERY link on the website of get-parameter — would be the right and simple solution, isn't it?
Put the cookie until the browser is closed, and that's all.
October 8th 19 at 03:21
at the bottom put a link to "full site version" and write cook
October 8th 19 at 03:23
1. If no cookie version of the site to determine the browser. If there are cookies then apply the style that cochise.
2. To make the choice of mobile style/css and using GET to pass a parameter (1 time is enough to pass to create cookie).
After clicking the link if($_GET['style']=='mobile') {Loadable mobile style... create a cookie that the user has selected cell}

Can you show how I have everything organized on some sites.
October 8th 19 at 03:25
1.On the main or any other place choice:
<a href="/?stheme=html">web</a> / <a href="/?stheme=mobile">mobile</a>

2.Check GET and set the cookie:
if($_GET['stheme']=="html")<br> {<br> setcookie('stheme', html);<br> define(HTML_STYLE,'on');<br> }<br> if($_GET['stheme']=="mobile")<br> {<br> setcookie('stheme', "mobile");<br> define(MOBILE_STYLE,'on');<br> }

3. Depending on the cookies set style or is already there as you want.
October 8th 19 at 03:27
don't know what you website says, but the logic of this.
Connect as In this check for cookie, if no cook do I insert @import default styles.
If the cookie is, the insert styles only for desktop or mobile.
Which is the definition
Although you can just as well at the template level to identify browser and depending on it to connect the required styles.
PS I would do one style for individual gamers, so as to minimize its size, and one full, which is everything.
Yes, harder to maintain, but you can choose the mobile style to connect using @import in main.

Find more questions by tags CVS