Search KB Filter article types
Storage Scopes CodeSample - Setting and retrieving a Cookie variable
Categories: State Serialization, Session Serialization
Tags: Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
Revision: 1
Posted: 08/Nov/2009
Updated: 22/Nov/2010
Status: Publish
Types: Article

This article will have a few sections added to it soon, based on the following article type skeleton: CodeSample
Overview

This very simple CodeSample, a part of the Storage Scopes series or articles, will show you how to set and retrieve the value of a Cookie variable.

VB.NET Code
' Setting a cookie
 VWGContext.Current.Cookies("Username") = "someuser"
 
 ' Retrieving a cookie
 Dim CurrentUser As String = VWGContext.Current.Cookies("Username")
 
 ' Clearing a cookie
 VWGContext.Current.Cookies("Username") = nothing

C# Code
// Setting a Context variable
 this.Context("Username") = "Some User";
 
 // Retrieving a Context variable
 string strCurrentUser = this.Context("Username");
 
 // Clearing a Context variable
 this.Context("Username") = String.Empty;

About the author

Related Articles

State Serialization  
Title Update Author
Tags: Architects, Developers, Visual WebGui Pipeline, 2. Intermediate, 3. Advanced, Optimizing Performance, Pre v6.3, v6.3, v6.4 and Later
10/Dec/2010    2010/12/10
Tags: Architects, Developers, Visual WebGui Pipeline, 2. Intermediate, 3. Advanced, Optimizing Performance, v6.4 and Later
24/May/2010    2010/05/24
Tags: Architects, Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, 3. Advanced, Pre v6.3, v6.3, v6.4 and Later
04/Dec/2010    2010/12/04
Tags: Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
23/July/2010    2010/07/23
Tags: Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
24/Nov/2010    2010/11/24
Tags: Developers, Visual WebGui Pipeline, 1. Beginner, 2. Intermediate, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
23/July/2010    2010/07/23