Copied to clipboard

Flag this post as spam?

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


  • Ryan 34 posts 136 karma points
    Apr 08, 2015 @ 15:44
    Ryan
    0

    Editing Umbraco Login Cookie

    Hi all,

    I have situation where one member has access to content based on there location, basically one member can have many locations. In simple terms I'm trying to edit the cookie that is created once a member has logged in ( I want to add the location). I've seen the SetAuthCookie function (below) but I'm not completely sure I can manipulate this to do what I need or if I should just create a new cookie?. If anyone can give me a kick in the right direction it would be greatly appreciated.

    FormsAuthentication.SetAuthCookie(username, true);
    

    Thanks

  • Martin Griffiths 780 posts 1177 karma points c-trib
    Apr 08, 2015 @ 16:55
    Martin Griffiths
    0

    Hi Ryan

    Use the forms authentication ticket method to construct a ticket (cookie) https://msdn.microsoft.com/en-us/library/kybcs83h(v=vs.110).aspx 

    This method allows for a small amount of userData to be stored in the ticket which you can read back when a member logs in. A full code example is included in the link, further down the page. This is standard asp.net forms authentication stuff, which more recent versions of Umbraco membership use ootb.

    Martin.

  • Ryan 34 posts 136 karma points
    Apr 08, 2015 @ 17:01
    Ryan
    0

    Hi Martin,

    Thanks for the link, just what I'm after!

Please Sign in or register to post replies

Write your reply to:

Draft