473,800 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple question about cookie:

Hi!

From what I understand cookies could be persisted or in-memory.

I need to set second one...

This code:
Response.Cookie s["phpbb_data "].Value = Server.UrlEncod e(phpC);
Response.Cookie s["phpbb_data "].Path = "/";
Response.Cookie s["phpbb_data "].Expires = DateTime.Now.Ad dMinutes(1);

would place cookie on HDD regardless of "Expires" property (even if I don't
set it)

In MSDN I found object Cookie with property Discard. This is what I need,
but the one I use is HttpCookie.

How do I set this in-memory cookie???

Thanks!
Nov 18 '05 #1
4 1304
If you create a cookie and don't set an expiration, it will expire as soon
as the browser session ends.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uP******** ******@tk2msftn gp13.phx.gbl...
Hi!

From what I understand cookies could be persisted or in-memory.

I need to set second one...

This code:
Response.Cookie s["phpbb_data "].Value = Server.UrlEncod e(phpC);
Response.Cookie s["phpbb_data "].Path = "/";
Response.Cookie s["phpbb_data "].Expires = DateTime.Now.Ad dMinutes(1);

would place cookie on HDD regardless of "Expires" property (even if I don't set it)

In MSDN I found object Cookie with property Discard. This is what I need,
but the one I use is HttpCookie.

How do I set this in-memory cookie???

Thanks!

Nov 18 '05 #2
It doesn't. It show
ExpirationDate 1/1/0001 12:00:00 AM

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
If you create a cookie and don't set an expiration, it will expire as soon
as the browser session ends.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uP******** ******@tk2msftn gp13.phx.gbl...
Hi!

From what I understand cookies could be persisted or in-memory.

I need to set second one...

This code:
Response.Cookie s["phpbb_data "].Value = Server.UrlEncod e(phpC);
Response.Cookie s["phpbb_data "].Path = "/";
Response.Cookie s["phpbb_data "].Expires = DateTime.Now.Ad dMinutes(1);

would place cookie on HDD regardless of "Expires" property (even if I

don't
set it)

In MSDN I found object Cookie with property Discard. This is what I need, but the one I use is HttpCookie.

How do I set this in-memory cookie???

Thanks!


Nov 18 '05 #3
how the browser remembers a cookie is browser dependant. IE always writes
the cookie to disk even if its a session cookie (no expir date)

cookies are just header records on a web request or response. when the
browser sees a cookier header in a response, it stores it for future use.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uP******** ******@tk2msftn gp13.phx.gbl...
Hi!

From what I understand cookies could be persisted or in-memory.

I need to set second one...

This code:
Response.Cookie s["phpbb_data "].Value = Server.UrlEncod e(phpC);
Response.Cookie s["phpbb_data "].Path = "/";
Response.Cookie s["phpbb_data "].Expires = DateTime.Now.Ad dMinutes(1);

would place cookie on HDD regardless of "Expires" property (even if I don't set it)

In MSDN I found object Cookie with property Discard. This is what I need,
but the one I use is HttpCookie.

How do I set this in-memory cookie???

Thanks!

Nov 18 '05 #4
Is there any way to read/write cookies "by hand" i.e. not using .NET object
but altering header directly?

I have following problem: I need to integrate PHP and ASP.NET portions of
site. I should write cookie that PHP will recognize and read/delete PHP set
cookie.

Right now I'm having really strange problems... Is it possible to have 2
cookies with the same name? When I place cookie thru asp.net php doesn't see
it and place another one and my debug page in asp.net show 2 identical
cookies...


"bruce barker" <no***********@ safeco.com> wrote in message
news:uE******** ******@TK2MSFTN GP09.phx.gbl...
how the browser remembers a cookie is browser dependant. IE always writes
the cookie to disk even if its a session cookie (no expir date)

cookies are just header records on a web request or response. when the
browser sees a cookier header in a response, it stores it for future use.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uP******** ******@tk2msftn gp13.phx.gbl...
Hi!

From what I understand cookies could be persisted or in-memory.

I need to set second one...

This code:
Response.Cookie s["phpbb_data "].Value = Server.UrlEncod e(phpC);
Response.Cookie s["phpbb_data "].Path = "/";
Response.Cookie s["phpbb_data "].Expires = DateTime.Now.Ad dMinutes(1);

would place cookie on HDD regardless of "Expires" property (even if I

don't
set it)

In MSDN I found object Cookie with property Discard. This is what I need, but the one I use is HttpCookie.

How do I set this in-memory cookie???

Thanks!


Nov 18 '05 #5

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

Similar topics

1
1624
by: wasian_god | last post by:
yea im knew to python, and i kno this is a very simple question. im trying to make a shell dat first says I want a cookie. Then it waits for the user to input the word cookie. while cookie is not inputted a timer counts down and at the end it prints out I want a cookie again. The timer then gets shorter. Heres what i have so far... print "I want a cookie!" m = 10 y = m
1
2670
by: mark leeds | last post by:
i am not a javasript programmer by any stretch but i have been writing a javascript programmer for a friend that does the following : 1) prompts the user for first name, middle name and last name 2) saves the data in a cookie 3) spits the cookie data back out to the respective fields
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
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
1607
by: mehdi_mousavi | last post by:
Hi folks, Consider the following JavaScript function: function removeParam(str, name) { var rgx = new RegExp('(' + name + '=\\w*)|(' + name + '=\\w*;)'); rgx.global = true; rgx.ignoreCase = true; var matches = rgx.exec(str); if(matches == null)
6
2122
by: alex.kemsley | last post by:
Hi guys, I am trying to write a simple script in vain. I need it to first check to see if the cookie exists then if not write one with two variable var ref = document.referrer var page = location.href
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...
17
5826
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /* Simple Thread Object ______________________________________________________________*/ #include <pthread.h> extern "C" void* thread_entry(void*);
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.