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.

Incorrect output of {if logged_in}{if logged_out} conditionals.

August 05, 2011 9:34am

Subscribe [2]
  • #1 / Aug 05, 2011 9:34am

    Laisvunas

    879 posts

    Hi,

    I’m logged in into EE v1.7.1 Control Panel as superadmin.

    There is in the template the following code:

    {if logged_in}
    
    I'm logged in!
    
    {/if}
    
    {if logged_out}
    
    I'm logged out!
    
    {/if}

    For some reason {if logged_out} incorrectly evaluates to TRUE and {if logged_in} incorrectly evaluates to FALSE and the string “I’m logged out!” is being outputted.

    What might be done to get correct output?

  • #2 / Aug 06, 2011 8:29am

    Sue Crocker

    26054 posts

    Hi, Laisvunas.

    I normally see this problem when there is a mismatch between the name of the site - the www or non-www versions. In other words, if you’re logged in to the www version of the control panel and the non www version of the site - you aren’t cookied in. You need to set the cookie domain to get around the problem. Does that help?

  • #3 / Aug 06, 2011 1:15pm

    Laisvunas

    879 posts

    Yes, that worked. Thank you!

  • #4 / Aug 06, 2011 10:55pm

    Sue Crocker

    26054 posts

    Glad that worked for you.. If anything else comes up, please do let us know in a new thread..

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

ExpressionEngine News!

#eecms, #events, #releases