Cookie enabled browsers

Results 1 to 3 of 3

Thread: Cookie enabled browsers

  1. #1
    John Egan Guest

    Default Cookie enabled browsers

    Got sort of a tough one (at least for me, a beginning ASP person). Our site relies on cookes, especially the purchasing pages. I&#039m trying to build some functionality that will check the client browser to see if it accepts cookies. If not, I&#039ll redirect them to our cookie info page. Ours is a very complex site, with many paths into the purchasing section, even some from outside our site. I&#039m affraid this will prevent me from setting a cookie on one page, then checking for it on the most critical pages. Ideally, I&#039d like to both set the cookie and check for it on the same page. I found the following code on 15seconds, which works fine, as long as you know the complete URL of the page that houses this code. I&#039m not so lucky, our purchasing page is acutally a single document that changes depending on a string embedded in the URL that points to this page.<BR><BR>&#060;%<BR> Response.Expires=0<BR><BR>strCookie = Request.Cookies("COOKIE")<BR>strTry = Request.QueryString("Try")<BR><BR><BR>If IsNull(strCookie) OR ( Len(strCookie) = 0) Then<BR><BR>&#039 Check to see if this is a redirect after the cookie<BR>&#039 has been set<BR><BR>If IsNull(strTry) OR (Len(strTry) = 0) Then<BR><BR>Response.Cookies("COOKIE") = "Set"<BR><BR>&#039 Redirect to this page and try again.<BR>Response.Redirect("getcookies.html?Try=Y es")<BR>Else<BR><BR>&#039 User/Browser didn&#039t accept cookies<BR>&#039 Do something...<BR><BR>Response.Redirect("/find/error/cookie_error.html")<BR><BR>End If<BR>End If<BR>&#037;&#062;<BR><BR>In order to get something like this to work, I was wondering if there is some way of capturing the referencing URL to this page, then assign it to a variable, then use that variable to reload the page and check for the cookie. This URL will have several possible values in the string...<BR><BR>Any help, suggestions, etc... would be greatly appreciated.<BR><BR>Thanks in advance<BR><BR>John Egan

  2. #2
    Jay Reid Guest

    Default RE: Cookie enabled browsers

    Have you thought of using a Session variable to hold the URL? Then calling the session Variable when you need it.<BR><BR>

  3. #3
    ActiveALLI Guest

    Default RE: Cookie enabled browsers

    You asked "I was wondering if there is some way of capturing the referencing URL to this page, then assign it to a variable,"<BR><BR>Yes you can .. <BR>&#060;%<BR>Dim strRef<BR>strRef = Request.ServerVariables("HTTP_REFFERER")<BR>&#037; &#062;<BR>Hope this helps <BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts