Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lee 1130 posts 3088 karma points
    Jan 09, 2011 @ 13:57
    Lee
    0

    Constant Automatic Logging Out?

    Ok slightly strange thing happening on all out Umbraco sites, I had to reboot our 1&1 server after upgrading the cloud memory etc... and now as soon as I login into any Umbraco site I'm logged out within 10 seconds?  

    I'm completely miffed?  Anyone experienced anything similar before?

  • Lee 1130 posts 3088 karma points
    Jan 09, 2011 @ 14:23
    Lee
    0

    So I have just checked its not a server wide thing with all sites, I have tried three NopCommerce sites and a couple of ASP sites and they are fine?  Its only the Umbraco sites on the server that its happening too? :S

    Any pointers as to where to start looking would be great.  Front end of the sites are fine, its just when you login to the Umbraco admin within a few seconds it just redirects to the login page as if I have pressed logout?

  • Lee 1130 posts 3088 karma points
    Jan 09, 2011 @ 14:38
    Lee
    0

    Now I am even more confused... If I use Firefox, its fine and doesn't log me out? Works without a problem!!  

    If I use Chrome or IE I get logged out after a few seconds?? Help...

    Could really use some advice from a techy if there are any on here? :S  

  • Lee 1130 posts 3088 karma points
    Jan 10, 2011 @ 09:49
    Lee
    0

    Bump... Still happening :(  Any ideas on where I could look? Nothing in UmbracoLog :S

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jan 10, 2011 @ 10:17
    Tim
    0

    Could be cookie related? If it's logging you out, that means the umbraco context cookie has probably vanished. After logging in, find the umbraco context cookie, then after it's punted you out, check to see if its still there. If it's gone, its an issue there (not sure what might be causing it though).

  • Lee 1130 posts 3088 karma points
    Jan 10, 2011 @ 10:32
    Lee
    0

    Hey Tim - Thanks for the help.  The cookie is disappearing, I login and the below cookie is added (This is using Chrome)

    When I'm logged out the UserContext cookie is not present?  I'm miffed as to why its just started happening when these sites have been fine!

  • Ian Smedley 97 posts 192 karma points
    Jan 10, 2011 @ 10:50
    Ian Smedley
    0

    Seems really weird to me, what version of Chrome are you using? 

    It might be worth also downloading Fiddler and seeing if there is anything obviously wrong coming back from the server, what is the cookie expiration date?

    Perhaps there is an issue with the server time?

  • Lee 1130 posts 3088 karma points
    Jan 10, 2011 @ 10:58
    Lee
    0

    Hi Ian.. You have something with the expiration time, have a look at this

    Why on earth would it be setting the expiration to 10 seconds?

  • Ian Smedley 97 posts 192 karma points
    Jan 10, 2011 @ 11:13
    Ian Smedley
    1

    It shouldn't the Umbraco code sets the cookie to expire 1 day from server time.

    // Create new cookie.
                    System.Web.HttpCookie c = new System.Web.HttpCookie("UserContext");
                    c.Name = "UserContext";
                    c.Value = value;
                    c.Expires = DateTime.Now.AddDays(1);
                    System.Web.HttpContext.Current.Response.Cookies.Add(c);

     

    It might be worth trying to upload a page which outputs the server time, just to rule out that it's hasn't been set completly wrongly on the new server, but still, it seems strange, 8 seconds less than a day out..

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(DateTime.Now.ToString());
        }
    </script>
    
    <body>
        <form id="form1" runat="server">
        </form>
    </body>
    </html>
  • Lee 1130 posts 3088 karma points
    Jan 10, 2011 @ 11:19
    Lee
    0

    Ian top man, you made me open my eyes on the server... Found the problem, how weird is this... BOTH servers date was a day behind, they were showing 9th! Changed it to the 10th and works perfectly :)

    Thanks for the help, really appreciate it

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jan 10, 2011 @ 11:19
    Tim
    1

    What Ian said, and in Firefox, what does it list the cookie expiration as (as that seems to work correctly)?

  • Lee 1130 posts 3088 karma points
    Jan 10, 2011 @ 11:20
    Lee
    0

    All sorted now Tim, thanks for the fault finding help... No one has touched the date/time on the servers so its definitely something 1&1 have done with moving the cloud servers to a new node.

  • DWT 12 posts 32 karma points
    Jul 24, 2015 @ 17:49
    DWT
    0

    I am hving this issue – where can I find the cookie setting code? Do I just add another day to it?

Please Sign in or register to post replies

Write your reply to:

Draft