ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Login and Logout not working

November 14, 2012 6:03am

Subscribe [1]
  • #1 / Nov 14, 2012 6:03am

    truthnews

    37 posts

    v2.5.3 - Build Date: 20120911

    I am using EE tags exactly as described in the manual, and I am using the officially sanctioned .htaccess method to rewrtie URLS.

    The login and logout links execute and the notification appears saying that I have been logged in or out, but there is no effect - neither works. The only way I can log in or out is using the control panel or clearing cookies manually.

    Here is my page code:

    {embed ="framework/doc_head" url="{site_url}radio-archives" title="Truth News Australia Sign In" description="Sign in or create a new account."}
    
    <div id="container">
     {embed="framework/header"}
    
     {embed ="framework/navigation"}
    
    
     <div id="main">
             <h2>Sign In Page</h2>
    <p>         <br />
         {if logged_in}<br />
               <a href="http://{path=member/profile}">Edit your profile</a></p>
    
    <p>           <a href="http://{path=member/memberlist}">View the Memberlist</a></p>
    
    <p>           <a href="http://{path=logout}">Log Out</a><br />
         {/if}<br />
         <br />
         <br />
         {if logged_out}<br />
           {embed=sign-in/logged_out}<br />
         {/if}<br />
            <br />
       </div><br />
            <br />
     <br />
         {embed="framework/right_col"}<br />
         {embed="framework/footer"}</p>
    
    <p></div><br />
    {embed ="framework/doc_foot"}

    Login code:

    {exp:member:login_form return="index"}
    
    <label>Username</label>
    
    <input type="text" name="username" value="" maxlength="32" class="input" size="25" /></p>
    
    <label>Password</label>
    
    <input type="password" name="password" value="" maxlength="32" class="input" size="25" /></p>
    
    {if auto_login}
    <input class='checkbox' type='checkbox' name='auto_login' value='1' /> Auto-login on future visits
    {/if}
    
    <input class='checkbox' type='checkbox' name='anon' value='1' checked='checked' /> Show my name in the online users list
    
    <input type="submit" name="submit" value="Submit" /></p>
    
    <a href="http://{path=member/forgot_password}">Forgot your password?</a>
    
    {/exp:member:login_form}

    .htaccess:

    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    Cookie Domain is set to ‘.’

    CP login/out is working fine.

    Thanks!

     

  • #2 / Nov 14, 2012 6:17am

    truthnews

    37 posts

    Correction: If I am logged in, then logging out using the control panel has no effect on the EE tag (It still thinks I am logged in). In this scenario it seems the only way I can log out is by manually deleting my cookies.

    If I am logged OUT, I can log in using the control panel, and the ee tag then seems to work as expected.

    NOTE: both “Control Panel Session Type” and “User Session Type” are set to: “Cookies only”.

    NOTE: I have tested this in Firefox 16.0.2 and IE Explorer 9 (Windows).

  • #3 / Nov 14, 2012 12:32pm

    glenndavisgroup

    436 posts

    Hi truthnews,

    Are you logging in to the CP and website from the same browser instance with 2 separate tabs? Or do you have 2 different browser instances, one for CP and one for the website? If you are just opening 2 tabs in the same instance then that’s why you are seeing this issue. The browser will use the active logged in cookie from the CP to auto log you in to the website. But if you try this from 2 different browser instances (not tabs but 2 browser windows) then it will work. Try it and see how that goes.

    Thank you,

    Mike

  • #4 / Nov 15, 2012 5:27pm

    Dan Decker

    7338 posts

    Hi truthnews,

    Your Cookie domain should be clear or complete. Just having the ‘.’ is likely the problem.

    Clear that and clear your cookies and let me know the results.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases