[thelist] [ASP] cookie question

Ken Schaefer ken at adOpenStatic.com
Wed Feb 26 21:17:01 CST 2003


I'm not sure what you mean by "your code does not work" - you just want to
redirect somewhere...

Your code snippet can be collapsed from:

 'nav=2&id=1 specifies the content for the page the cookie value redirects
to
: if request("nav") = 2 and request("id") = 1 then
: session("online") = True
: session.timeout = 60
: end if
:
: 'creating this session was how I got around the redirect loop
: if Session("online") <> True then
: homepage=request.Cookies("homepage")
: if homepage = "onlineCodes" then
: response.Redirect("index.asp?nav=2&id=1")
: end if

to

<%
If Not (Request("nav") = 2 and Request("id") = 1) then
   strHomepage=request.Cookies("homepage")

    If strHomepage = "onlineCodes" then
        Response.Redirect("index.asp?nav=2&id=1")
    End If

End If
%>

since that's all your current stuff does.

Cheers
Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Stephen Caudill" <SCaudill at municode.com>
To: <thelist at lists.evolt.org>
Sent: Thursday, February 27, 2003 3:58 AM
Subject: RE: [thelist] [ASP] cookie question


: Ken Schaefer wrote:
: > When the user next comes back to the site, I don't see what you can't
: > do:
: >
: > <%
: > strRedirect = Request.Cookies("Homepage")
: > strParams = Request.Cookies("OptionalParams")
: >
: > Select Case strRedirect
: >     Case "FirstHomePage"
: >         Response.Redirect("/somesite/")
: >     Case "SecondHomePage"
: >         Response.Redirect("/someothersite/default.asp?" & strParams)
: > End Select %>
:
: Thanks for replying Ken, I was beginning to think that I was the only one
that ever saw my posts.  Unfortunately because of the way the site is
structured (using a bastardized version of the FuseBox methodology that
calls all content into the index page based on querystring parameters) your
method did not work.  I have figured it out though and I thought I would
post the solution in case anyone was interested.
:
: <%
: 'home = 1 is the parameter used to set the cookie
: home = int(request("home"))
: if home = 1 then
: response.Cookies("homepage") = "onlineCodes"
: response.Cookies("homepage").expires = "01/01/04"
: end if
:
: 'nav=2&id=1 specifies the content for the page the cookie value redirects
to
: if request("nav") = 2 and request("id") = 1 then
: session("online") = True
: session.timeout = 60
: end if
:
: 'creating this session was how I got around the redirect loop
: if Session("online") <> True then
: homepage=request.Cookies("homepage")
: if homepage = "onlineCodes" then
: response.Redirect("index.asp?nav=2&id=1")
: end if
: end if
: %>
:
: So, thar she blows.  The page in question is at:
: http://neohero.municode.com/fusion/index.asp?nav=2&id=1
:
:
: Thanks,
: Stephen Caudill
:
: --
: * * Please support the community that supports you.  * *
: http://evolt.org/help_support_evolt/
:
: For unsubscribe and other options, including the Tip Harvester
: and archives of thelist go to: http://lists.evolt.org
: Workers of the Web, evolt !




More information about the thelist mailing list