Cookies not working

  • 14 years ago
    I have a form with an Textbox

    When you write into it and hit the submit button he must create an cookie

    I use the code:

    <%

    response.cookies("user") = request.form("user")

    %>

    On the next page he does:

    request.cookies("user")

    nothing is happening.

    I am using IIS6



















  • 14 years ago

    Hi,

    I had trouble with cookies as well.

    This is the code i used in VB.Net,

    Response.Cookies.Add(New HttpCookie("Sess", Session.SessionID)
    Response.Cookies("Sess").Expires = DateTime.Now.AddDays(1)

    It might be necessary for you to set the expiry to make sure that it isn't being destroyed straight away.

    Si

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The question of whether computers can think is just like the question of whether submarines can swim.” - Edsger W. Dijkstra