473,799 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple question about cookies

Joe
Hi,

I’m creating a cookie named “tick” that should expire after 1 day when user
logs in.

TheDomain = ".www.test. com"
ThePath = "/dir1/subdir"
Response.Cookie s("tick")("ID ") = Session("userEm ail")
Response.Cookie s("tick").Expir es = DateAdd("d", 1, Now())
Response.Cookie s("tick").Domai n = TheDomain
Response.Cookie s("tick").Pat h = ThePath

I want to have a logout link. When clicked, I am trying to set the expiry
date of cookie to say 5 days back like this to tell browser that this cookie
has expired and it should remove it.

Response.Cookie s("tick").Expir es = DateAdd("d", -5, Now())

But I noticed that I am not able to change the cookie’s expiry date by above
line. Can someone tell me what mistake I’m making?

Thanks,

Joe

Aug 4 '05 #1
0 1035

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2220
by: Sims | last post by:
Hi, I am using setcookies to store one single value. But i was reading http://za2.php.net/manual/en/function.setcookie.php and i noticed that a cookie might not be accepted yet it might return true. So that makes me wonder what the use of the cookies are if i have no way of making sure that it has been properly accepted. What is the point of having cookies if i have to make a backup plan for users that do not accept them? What do you...
111
14434
by: Retlak | last post by:
The recommended (on dozens of websites) and effective (works in Netscape, MSIE, Mozilla, probably others) way to detect if a browser has Javascript turned off is to put this in the <head>: <noscript> <meta http-equiv="refresh" content="1;url=http://yourURL/nojscript.html"> </noscript> This redirects to a doc which typically says "You need to enable
4
1304
by: Ivan Demkovitch | last post by:
Hi! From what I understand cookies could be persisted or in-memory. I need to set second one... This code: Response.Cookies.Value = Server.UrlEncode(phpC); Response.Cookies.Path = "/"; Response.Cookies.Expires = DateTime.Now.AddMinutes(1);
1
1122
by: Jeff | last post by:
When is the value of an authentication cookie sent from the browser to the server - when the value is read from the Cookies collection? Or, is it possible that the Cookies collection is populated immediately on the server when a new browser session is created? Thanks!
1
1036
by: Shapper | last post by:
Hello, I need to know how to do 2 things: 1. CREATE a NEW cookie with 2 values: "password" and "user". 2. APPEND 2 new values to an ALLREADY EXISTING cookie. I created a code which is working: Dim cookie As HttpCookie = New HttpCookie("MyCookie") cookie.Values.Add("culture", "pt-PT") cookie.Expires = #01/01/2010#
1
989
by: Joe | last post by:
Hi, I’m creating a cookie named “tick” that should expire after 1 day when user logs in. TheDomain = ".www.test.com" ThePath = "/dir1/subdir" Response.Cookies("tick")("ID") = Session("userEmail") Response.Cookies("tick").Expires = DateAdd("d", 1, Now()) Response.Cookies("tick").Domain = TheDomain
7
2291
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request that page like http://machinename/dir1/hellp.aspx instead of running that page it starts downloding ...whats missing here ....why the aspx engine not running the page....
0
1235
by: Alan Silver | last post by:
Hello, I am having a problem setting and resetting cookies. I'm sure I just doing something really stupid as this is such a basic issue, but I can find any answer. Please can someone help me? The following code is a complete page that demonstrates my problem. If you save this as an .aspx and load it in a browser, it tells you it is creating the cookie. If you reload the page, it tells you it is changing the value. If you reload it...
3
1323
by: Groove | last post by:
Hey guys - hoping you can help me out here. I'm using asp.net 2 (VB) and trying to set and retrieve values from a cookie. I've done this a few times before w/o a problem but I seem to be overlooking something here. I'm even following my previous working examples and I can't see the different. I have a page that will remember the user's settings using a cookie. Ther Calendar Events, recent orders, etc will be displayed or hidden based...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.