Re: Setting a cookie question
From: Jim Buyens (news_at_interlacken.com)
Date: 06/28/04
- Next message: Tom Pepper Willett: "Re: Custom gif for "Hit counters""
- Previous message: Mickster: "Re: Custom gif for "Hit counters""
- In reply to: Steve Grosz: "Re: Setting a cookie question"
- Messages sorted by: [ date ] [ thread ]
Date: 28 Jun 2004 11:44:40 -0700
Yes, the page sets the cookie for me. I discovered this by:
1. Choosing Internet Options from the Tool menu.
2. On the General Tab, under Temporary Internet
Files, clicking Settings
3. In the Settings dialog box, clicking View Files.
4. In the resulting Windows Explorer window, clicking
the Last Modified column heading until that column
appears in descending order.
5. Searching visually from the top of the list.
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
Steve Grosz <boise_bound@hotmail.com> wrote in message news:<OiDMs#RXEHA.1496@TK2MSFTNGP10.phx.gbl>...
> So, here's the code I have on the main page (or at least the cookie part):
>
> <body>
> <%
> If Request.Cookies("Unique") = "" Then
> Response.Cookies("Unique") = "visited"
> Response.Cookies("Unique").Expires = now() + 30
> End If
> %>
> <p align="center">
> <img src="images/logo1.jpg">
> </p>
>
> And it still doesn't seem to be setting it, even with the browser
> settings set as low as they'll go. Can you see if the page is setting
> it for you? www.scootervilleusa.com
>
> Thanks!
>
> Steve
>
>
>
> Jim Buyens wrote:
>
> >Curious, because this code definitely works on my system.
> >
> >I'd say the next thing to check are your Internet security settings.
> >Make sure you allow cookies for the Web server in question.
> >
> >Jim Buyens
> >Microsoft FrontPage MVP
> >http://www.interlacken.com
> >Author of:
> >*----------------------------------------------------
> >|\---------------------------------------------------
> >|| Microsoft Office FrontPage 2003 Inside Out
> >||---------------------------------------------------
> >|| Web Database Development Step by Step .NET Edition
> >|| Microsoft FrontPage Version 2002 Inside Out
> >|| Faster Smarter Beginning Programming
> >|| (All from Microsoft Press)
> >|/---------------------------------------------------
> >*----------------------------------------------------
> >
> >
> >Steve Grosz <boise_bound@hotmail.com> wrote in message news:<OLOd3t4WEHA.1048@tk2msftngp13.phx.gbl>...
> >
> >
> >>I'm not sure why its not being set then. I have the following code as
> >>the first line on the default.htm page:
> >>
> >><%
> >>If Request.Cookies("beenhere") = "" Then
> >> Response.Cookies("beenhere") = "donethis"
> >> Response.Cookies("beenhere").Expires = now() + 60
> >>End If
> >>%>
> >>
> >>If after posting the page, and then opening my browser and refreshing the page, the cookie should be set on my machine. If I search for the cookie, which I named Visitor instead of "beenhere", I don't find anything with Visitor on my machine.
> >>
> >>Why is that? Do I need to define something in the header file? I have a Javascript line as follows:
> >><script language="JavaScript" type="text/javascript" src="http://www.scootervilleusa.com/Menu/menu_scr.js">
> >>
> >>
> >>Would that be messing things up?
> >>
> >>Steve
> >>
> >>
> >>
> >>Jim Buyens wrote:
> >>
> >>
> >>
> >>>Typically, you would use code like:
> >>>
> >>>If Request.Cookies("beenhere") = "" Then
> >>> Response.Cookies("beenhere") = "donethis"
> >>> Response.Cookies("beenhere").Expires = now() + 60
> >>>End If
> >>>
> >>>The Response.Cookies collection contains cookies that the
> >>>server sends the browser.
> >>>
> >>>The Request.Cookies collection contains cookies that the
> >>>browser sends back to the server.
> >>>
> >>>The statement
> >>> Response.Cookies("beenhere").Expires = now() + 60
> >>>sets the expiration date of the "beenhere" cookie 60 days
> >>>in the future.
> >>>
> >>>Jim Buyens
> >>>Microsoft FrontPage MVP
> >>>http://www.interlacken.com
> >>>Author of:
> >>>*----------------------------------------------------
> >>>|\---------------------------------------------------
> >>>|| Microsoft Office FrontPage 2003 Inside Out
> >>>||---------------------------------------------------
> >>>|| Web Database Development Step by Step .NET Edition
> >>>|| Microsoft FrontPage Version 2002 Inside Out
> >>>|| Faster Smarter Beginning Programming
> >>>|| (All from Microsoft Press)
> >>>|/---------------------------------------------------
> >>>*----------------------------------------------------
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>I'm trying to find a way to set a cookie if it doesn't
> >>>>exist.
> >>>>
> >>>>I know with ColdFusion there are some good programming
> >>>>controls and commands, but not sure about ASP.
> >>>>
> >>>>Would something like this work?
> >>>>
> >>>><%
> >>>>If Not Exists("beenhere")
> >>>>Response.Cookies("beenhere") = "donethis"
> >>>>Response.Cookies("beenhere").Expires = "July 31, 2004"
> >>>>%>
> >>>>
> >>>>What I'm trying to do is check to see if the cookie
> >>>>exists, if not, set it.
> >>>>
> >>>>I also know that with ColdFusion you don't have to
> >>>>specify a actual end date, you can do it in number of
> >>>>days, can you do that with ASP?
> >>>>
> >>>>Thanks,
> >>>>Steve
> >>>>.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
- Next message: Tom Pepper Willett: "Re: Custom gif for "Hit counters""
- Previous message: Mickster: "Re: Custom gif for "Hit counters""
- In reply to: Steve Grosz: "Re: Setting a cookie question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|