Cookie Problems

Discussion in 'ASP General' started by Athmaus, Mar 16, 2005.

  1. Athmaus

    Athmaus Guest

    I have a techincal support form. And when the user hits submit i want to give
    them a cookie. When they try to access this page again in a 24-48 hour time I
    want the page to identify the cookie and redirect them to an alternative
    page. Yet i am having a problem with the page.

    Here is my code for the to give the cookie:

    Dim prod
    prod = "test"

    Response.Cookies("testing")= prod
    Response.Cookies("testing").Expires = Date + 1



    Here is the code to read the cookie:

    dim show, verify

    verify = "test"

    show = Request.Cookies("testing")

    If verify = show
    Then Response.Redirect "http://www.google.com"

    End If


    Any suggestions?

    Thanks!
     
    Athmaus, Mar 16, 2005
    #1
    1. Advertising

  2. Athmaus

    Athmaus Guest

    I couldnt give a "specific" problem becasue my debugger on IIS was messed up.
    Once they got it up and running agin i foudn the problem.

    I forgot to put an "End If" in once section since adding the reponse.cookie
    and than i had to chnage how to obatain the date by using the DateAdd()
    function.

    "Curt_C [MVP]" wrote:

    > what is the problem specifically? Are cookies enabled on the client?
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "Athmaus" <> wrote in message
    > news:...
    > >I have a techincal support form. And when the user hits submit i want to
    > >give
    > > them a cookie. When they try to access this page again in a 24-48 hour
    > > time I
    > > want the page to identify the cookie and redirect them to an alternative
    > > page. Yet i am having a problem with the page.
    > >
    > > Here is my code for the to give the cookie:
    > >
    > > Dim prod
    > > prod = "test"
    > >
    > > Response.Cookies("testing")= prod
    > > Response.Cookies("testing").Expires = Date + 1
    > >
    > >
    > >
    > > Here is the code to read the cookie:
    > >
    > > dim show, verify
    > >
    > > verify = "test"
    > >
    > > show = Request.Cookies("testing")
    > >
    > > If verify = show
    > > Then Response.Redirect "http://www.google.com"
    > >
    > > End If
    > >
    > >
    > > Any suggestions?
    > >
    > > Thanks!
    > >
    > >

    >
    >
    >
     
    Athmaus, Mar 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    3
    Views:
    5,913
    Steven Cheng[MSFT]
    Jun 3, 2004
  2. Shapper

    Cookie and Session Cookie Questions.

    Shapper, Apr 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    596
  3. =?Utf-8?B?UGF1bA==?=

    Cookie Question (IP as domain and cookie file location)

    =?Utf-8?B?UGF1bA==?=, Jan 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,513
    Bruce Barker
    Jan 10, 2006
  4. ad
    Replies:
    2
    Views:
    7,636
    Kevin Spencer
    Jan 27, 2006
  5. =?Utf-8?B?TnVubw==?=

    Convert a PHP cookie to an ASP.NET cookie

    =?Utf-8?B?TnVubw==?=, Jan 31, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    455
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 31, 2006
Loading...

Share This Page