Open HenriVesala opened 12 years ago
You offer good ideas, but the next month I will have very little time. You can do PR's or I can add you to the list of collaborators. Together productively! If you are interested?
Yeah. I have bit similar situation ongoing but I shall make PR's in the future if I have time. You can also add me to collaborator if you like.
This feature wasn't included in my PR and is still in todo list.
Ok I hastened )
Is this going to be added? This is an issue I had as well where the cookie kept the user on the full version and they'd have to manually switch back.
My work around for now is:
if ($mobile_detector->isMobile()) {
$response = new Response;
$response->headers->clearCookie(DeviceView::COOKIE_KEY);
$response->send();
}
In the controller, might not be the best way but session based would definately be good!
Currently I don't have any need for this feature so I think nobody is working on it. Feel free to make pullrequest if you have solution.
I also need this feature. Can't you guys just solve it with Cookie Lifetime?
Now we have 30 days, just change it to expire=0 and we're all set?
I think we'd need a way to get back to the mobile view (or in other words: to the default device behaviour), regardless of cookie lifetime or whether the view overwriting is attached to the session.
I found another workaround that seems to work: I included the following at the very bottom of my "desktop" template:
{% if is_mobile() %}
<a href="?device_view=mobile">
To mobile version »
</a>
{% endif %}
Thanks to the is_mobile() check, this will only ever be displayed if a mobile device displays the full version (which only happens when the view is overridden).
Applying this trick in your mobile template could also be helpful to give accidental desktop visitors a chance of reaching the corresponding full desktop page (though #43 would be nice, too :)).
Current problem is that when user visit the sit with mobile and he decides to check full page version he is stuck with full page version unless he manually switches back. I think that it would be logical to always redirect new mobile sessions to mobile page.