Setting a Cookie (VB.net) : Cookie « Session Cookie « ASP.Net






Setting a Cookie (VB.net)

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Setting a Cookie in ASP.NET</title>
      <script runat="server">
         Sub Page_Load()
            Dim myCookie As New HttpCookie("LoggedIn")
            myCookie.Value = "True"
            myCookie.Expires = DateTime.Now.AddMinutes(30)
            Response.Cookies.Add(myCookie)
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>
           
       








Related examples in the same category

1.Create and retrieve Cookie data (C#)
2.Display all Cookie (C#)
3.Delete Cookie (C#)
4.Delete All Cookies (C#)
5.Adding cache dependencies (VB.net)
6.Getting cookie values in ASP.NET
7.Setting expire date and path for cookies in ASP.NET (VHB.net)
8.Write Cookie and read Cookie (VB.net)
9.Save and retrieve values in Cookie (C#)
10.Save Cookie (Vb.net)
11.Set cookie expire date (VB.net)