edit. issue fixed. thank you for viewing
Okay i'm having some slight issues.

Each page has two different views. Mobile and Web format. When using the logout link on the Web format (normal) it works fine. The member is logged out.

However when i use the logout link on the mobile viewing side it wont log the member out, so if you log out it'll return you to the login page. But when you then visit the profile page the member is still logged in.

Thanks you in advance

My mobile code.

<!-- every template dealing with members has to begin with the following tag -->
<cms:member_check_login />

<!-- this is secured page. login first to access it -->
<cms:if k_member_logged_out >
<cms:redirect "<cms:member_login_link />" />
</cms:if >
<cms:if k_member_logged_out >


<cms:if k_member_logged_in >
<cms:pages masterpage=k_member_template id=k_member_id>

include 'Mobile_Detect.php';
$detect = new Mobile_Detect();
if ($detect->isMobile()) {
// Any mobile device.
global $CTX;
$CTX->set( 'is_mobile', '1' );

<cms:if is_mobile >
<meta name="viewport" content="width=device-width" />
Mobile content with the logout link

<cms:else />

Normal content.