Walter.Web.FireWall
WriteCookie(String,String,Boolean) Method
Example 
Walter.Web.FireWall Assembly > Walter.Web.FireWall Namespace > IUserIdentity Interface > WriteCookie Method : WriteCookie(String,String,Boolean) Method
Cookie Name
Cookie value
indicates the cookie is essential default is false
Write the string to a session cookie using the GDPR compliant cipher with the users Salt as password
Syntax
void WriteCookie( 
   string name,
   string value,
   bool isEssential
)

Parameters

name
Cookie Name
value
Cookie value
isEssential
indicates the cookie is essential default is false
Example
This sample shows how the user stores GDPR specific data securely using the users unique cypher key
public class ShopController : Controller
{
   private readonly IPageRequest _page;
   private ILatLongRepository _latLongRepository;
            
   public ShopController(IPageRequest page, ILatLongRepository latLongRepository)
   {
       _page = page;
       _latLongRepository = latLongRepository;
   }        
             
   public async Task<IActionResult> Index(ShoppingCard data)
   {
        int cardId = -1;
        if (_page.User.TryReadCookie("CredidCardId", out var sValue) && int.TryParse(sValue, out cardId))
        {
            //some magic code       
        }
   
        _page.User.WriteCookie("CredidCardId", cardId.ToString(CultureInfo.InvariantCulture));
        
   }
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IUserIdentity Interface
IUserIdentity Members
Overload List