Copied to clipboard

Flag this post as spam?

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


  • Pete 213 posts 285 karma points
    Oct 07, 2012 @ 15:57
    Pete
    0

    Cloud Hosting Auth Cookie / Form Sessions!

    Has anybody had any experience with using forms authentication and membership on shared cloud hosting platform?

    I've been trying to get a protected area working using the members area in umbraco as the membership provider, and having no end of issues. I've asked the hosting provider for help but nothing back from them yet.

    The issues are very intermittent and random:

    - Login won't work at all even after 10-20 attempts, then suddenly logs a member in.
    - Member kicked out after 2-3 page views, but sometimes could be 30 page views.
    - Member clicks to another page and shows them as not logged in, but do a page refresh and they're shown as logged in.

    I've took out all the code from the templates involved so it's extremely basic:

    - Login page with it's own template.
    - GalleryArea, own template. This is where the login redirects to. This node is protected in Umbraco.

    The issues all seem very random, and I've had no issues with the same setup on my local test server, or on other public servers - however these are standalone, non cloud or shared servers.

    The only thing relevant thing I can find is:

    Save your session data to Session State

    Session data is externalised in clustered environments due to the nature of the task at hand — saving session data on the webserver used for the request means potential loss of data as another request is made via a different node inside the cluster.

    We supply a Session State server to save session data to. The code to add to your web.config is:

    <sessionState mode="StateServer" stateConnectionString="tcpip=asp-ss.XXXXXXXX.net:42424"/>


    Also the hosting provider says on their support docs:

    " .NET users on Windows IIS servers are provided with an easy option for session data externalisation, a session state server.

    This server stores client session information separate from the IIS cluster, therefore sessions are maintained when visitors to your site are directed to a different IIS webserver by the load balancers. "

    Do I need to specify a machine key for the session to be authenticated?

    Any pointers extremely welcome!! Sorry for the long post!

    Thanks, Pete



  • Mike Chambers 636 posts 1253 karma points c-trib
    Oct 08, 2012 @ 10:33
    Mike Chambers
    0

    http://msdn.microsoft.com/en-us/library/ms178586(v=vs.100).aspx

    What you have found above also should work, and all you should need to change is the change tot he web.config. and as you say generate a machine key

    http://technet.microsoft.com/en-us/library/cc731979(v=ws.10).aspx - you can use iis on your dev box and then add the key to the web.config and use locally and on your host.

     

    You could also use a database to store your session state. That way session are maintened in one place across multiple db's.

    With our hosting provider we set up a blank mssql databse and got them to apply the scripts from MS to change to the session state storage medium.

    This was you can also query the db to see that rows are being added to the tables to match you user sessions... ;-)

     

     

     

     

     

  • Pete 213 posts 285 karma points
    Oct 08, 2012 @ 15:21
    Pete
    0

    Thanks Mike lots of good help there. Worked a treat.

Please Sign in or register to post replies

Write your reply to:

Draft