default userpic

Sign in not remembering me from page to page

Vote 0 Votes

I am working on a new site/blog with MT.

http://www.florencewinemerchants.com/

Once I sign in though, MT is forgetting me from page to page. The link at the top always says "Sign In | Not a member? Register" - even after I have signed in but clicked to a different page - and then if I click on Sign In again, I don't have to - it has me remembered and changes to "You are signed in as X | Edit profile | Sign out". Am I missing something in the header?

I have another blog on the same MT install and it is working fine http://www.ibizdaily.com/

Reported on Movable Type 4.2

19 Replies

| Add a Reply
  • I'm having the same problem and it's driving me crazy! I sign in as the administrator and have to sign in again every time I move to another page!

  • Elisa is it your only blog on the install or do you have multiple blogs?

  • Just the one blog on MT, but it is a subdomain with other blogs on WP under the same root.

  • Looks like there is something wrong with your JavaScript missing, which means that the cookie is not being set.

    // The cookie name to use for storing the blog-side comment session cookie.
    var mtCookieName = "mt_blog10_user";
    var mtCookieDomain = ".";
    var mtCookiePath = "";
    var mtCookieTimeout = 14400;

    should be something like this

    // The cookie name to use for storing the blog-side comment session cookie.
    var mtCookieName = "mt_blog10_user";
    var mtCookieDomain = "www.florencewinemerchants.com";
    var mtCookiePath = "\";
    var mtCookieTimeout = 14400;

  • Hmm - thanks Rob. I understand (I think) what you are saying - but I am not getting anywhere with it... this is a fresh install and I really have not done much to the templates - I didn't touch anything in the headers or javascript...
    So it sounds like the cookie is not being set properly - but I don't really understand what part(s) I am missing...
    I refreshed my js templates - no change...
    Darn - I am stumped.

  • Aha - so - the mt.js does contain the correct info -

    var mtCookieName = "mt_blog10_user";
    var mtCookieDomain = "www.florencewinemerchants.com";
    var mtCookiePath = "\";
    var mtCookieTimeout = 14400;

    but the page is not picking it up obviously. I am thinking something has gone wrong ala what Tim Appnel is talking about here: http://appnel.com/code/log/2007/09/customizing-mt4-comment-forms - mainly:

    "Be sure to keep the same HTML/CSS ids. The JavaScript library MT generated for each blog powers the display of the comment form and remembering a users info. I'm not going to list them all here because there are quite a few. The default comment form markup can be found in the file named comment_form.mtml in the mt4/default_templates directory."

    I also don't understand why when viewing source their is so much to see above the body tag on the florenewinemerchants.com home page, but so little on iBizDaily.com -

  • Got it - I think. I added some javascript to grab the mt:UserSessionState right after the open head tag in the header template. Sorry can't show the code here since the link above about sharing code doesn't work...

  • What have you done?

    I am seeing a lot of extra JavaScript (ranking code ) than a 100% clean copy of the pro template (view source on http://www.movabledemo.com/blogs/pro/)

  • Rob as to that code - no idea. I did get it working though :)
    Your link above is broken BTW -

  • Oops it added the ) as part of the link.

    Yes it is being set in the mt.js and reset on the page. Glad it is working now.

  • afinta, I picked up the code from the page you linked but I'm apparently not inserting it correctly. Here's where I put it:

     <div id="header">    <div id="header-inner">        <div id="header-content"><script type="text/javascript"> /* <![CDATA[ */ var user = <$mt:UserSessionState$>; /* ]]> */ </script><mt:Ignore><!-- Use h1 and h2 html tags on the main index of the blog as the title, use divs on all other pages where there are page titles. --></mt:Ignore><mt:If name="main_index">            <h1 id="header-name"><a href="<$mt:BlogURL$>" accesskey="1"><$mt:BlogName encode_html="1"$></a></h1>            <h2 id="header-description"><$mt:BlogDescription$></h2><mt:Else>            <div id="header-name"><a href="<$mt:BlogURL$>" accesskey="1"><$mt:BlogName encode_html="1"$></a></div>            <div id="header-description"><$mt:BlogDescription$></div></mt:If>        </div>    </div></div
    

    Am I even in the right module? I'm really really new at this...

  • Since that code isn't showing up for me, here it is again:

     <div id="header">    <div id="header-inner">        <div id="header-content"><script type="text/javascript"> /* <![CDATA[ */ var user = <$mt:UserSessionState$>; /* ]]> */ </script><mt:Ignore><!-- Use h1 and h2 html tags on the main index of the blog as the title, use divs on all other pages where there are page titles. --></mt:Ignore><mt:If name="main_index">            <h1 id="header-name"><a href="<$mt:BlogURL$>" accesskey="1"><$mt:BlogName encode_html="1"$></a></h1>            <h2 id="header-description"><$mt:BlogDescription$></h2><mt:Else>            <div id="header-name"><a href="<$mt:BlogURL$>" accesskey="1"><$mt:BlogName encode_html="1"$></a></div>            <div id="header-description"><$mt:BlogDescription$></div></mt:If>        </div>    </div></div
    
  • No - I don't think you are. You want to be in Design, Templates, Template Modules, Header -

    In that template - the Header template - you want to put that code after the open head tag, before the meta tags, etc.

    It looks like yours is much further down the page, in the body itself.

  • Okay, I found the right template but it's still not working. Here's where I put it:

     <mt:If tag="BlogTemplateSetID" eq="mt-community-forum"><$mt:Var name="page_layout" value="layout-wm"$></mt:If><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<$mt:BlogLanguage$>" lang="<$mt:BlogLanguage$>" id="sixapart-standard"><head><script type="text/javascript"> /* <![CDATA[ */ var user = <$mt:UserSessionState$>; /* ]]> */ </script>    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />    <meta http-equiv="Content-Style-Type" content="text/css" />    <meta http-equiv="Content-Script-Type" content="text/javascript" />    <meta http-equiv="imagetoolbar" content="no" />        <title><$mt:Var name="title"$></title>    <meta name="generator" content="<$mt:ProductName version="1"$>" />
    
  • elisa can you post a URL? I think one issue is that it looks like you are running the community-forum version and I am using the professional website.

  • So it turns out my fix was not properly working... I am back to where I was - logging in works, but when moving from page to page it appears you are not logged in, yet if you attempt to comment, when you click log in, you don't actually have to - the system is remembering me but just not showing it is from page to page... very frustrated here as I don't think I did much at all to these templates to have that acting so strange... or maybe it is just my Mac - I don't know.

  • the simple answer is usually the correct one...

    It's all in the preferences!

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1428 5076

Last Topic: Stupid Question? How to make a static homepage by Jeremy on Feb 3, 2012

694 2908

Last Topic: Blogspot to Movable Type by sdude on Feb 8, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 565

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012