I want to store a string in a cookie but i can't get it working.

This is the script that works;

VB Code:
  1. If Authenticated(txtuser.text,txtpass.text) then
  2.    
  3.     Dim ticket as New FormsAuthenticationTicket( txtuser.text, checkbox1.checked, 50 )
  4.     Dim encTicket As String = FormsAuthentication.Encrypt(ticket)
  5.     Dim cookie as New HttpCookie(FormsAuthentication.FormsCookieName,encticket)
  6.     'cookie("diruser") = "testpod"
  7.     Response.Cookies.Add(cookie)
  8.     response.redirect("Corefile.aspx?action=summary")
  9.     else
  10.    
  11.     Label1.text = "Bad username or Password"
  12.     end if
  13.     End Sub

But as soon as I un-comment the

cookie("diruser") = "testpod"

line the asp.net doesn't think the cookie is vaild and redirects the user to the login page.

My question is how do i store a value in a cookie and how to get it back?

Thanks