473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cookies don't work....HELP!!

I am using C# in ASP (Microsoft Visual Studio.Net) to try and create a cookie. I have cookies enabled on both of my computers, but when I use the following code (I have also tried the commented line as well), no cookies are created. Sometimes the 'index.dat' file gets updated (as far a the last saved date, no reference inside the file), but nothing

NOTE: txt_Reg is a text bo

private void aRegUser(

//Response.Cookies["testRegUser"].Value = this.txt_Reg.Text

HttpCookie RegMyUser = new HttpCookie("testRegUser")
RegMyUser.Value = this.txt_Reg.Text
RegMyUser.Expires = DateTime.Now.AddMonths(1)
Response.Cookies.Add(RegMyUser)
}
Nov 18 '05 #1
2 1171
After this executes, is there a Response.redirect? That can keep cookies
from saving

"Simple Person" <an*******@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
I am using C# in ASP (Microsoft Visual Studio.Net) to try and create a cookie. I have cookies enabled on both of my computers, but when I use the
following code (I have also tried the commented line as well), no cookies
are created. Sometimes the 'index.dat' file gets updated (as far a the last
saved date, no reference inside the file), but nothing.
NOTE: txt_Reg is a text box

private void aRegUser()
{
//Response.Cookies["testRegUser"].Value = this.txt_Reg.Text;

HttpCookie RegMyUser = new HttpCookie("testRegUser");
RegMyUser.Value = this.txt_Reg.Text;
RegMyUser.Expires = DateTime.Now.AddMonths(1);
Response.Cookies.Add(RegMyUser);
}

Nov 18 '05 #2
No. That is basicly all of the code. I call this block from the click event of a button on the page (I am checking to see if anything is entered before I call it). I watch the code and It goes through all of the line in this block of code, just no results. Is there maybe a server setting that needs to be set

----- David Jessee wrote: ----

After this executes, is there a Response.redirect? That can keep cookie
from savin

"Simple Person" <an*******@discussions.microsoft.com> wrote in messag
news:1B**********************************@microsof t.com..
I am using C# in ASP (Microsoft Visual Studio.Net) to try and create

cookie. I have cookies enabled on both of my computers, but when I use th
following code (I have also tried the commented line as well), no cookie
are created. Sometimes the 'index.dat' file gets updated (as far a the las
saved date, no reference inside the file), but nothing
NOTE: txt_Reg is a text bo
private void aRegUser(


//Response.Cookies["testRegUser"].Value = this.txt_Reg.Text
HttpCookie RegMyUser = new HttpCookie("testRegUser")

RegMyUser.Value = this.txt_Reg.Text
RegMyUser.Expires = DateTime.Now.AddMonths(1)
Response.Cookies.Add(RegMyUser)


Nov 18 '05 #3

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

Similar topics

1
by: Dave | last post by:
I am doing a complete backup on a sql 7 db and then doing a complete restore (with overwrite existing db) on a sql 2000 server. This is now our hot standby server. I have the process automated and...
0
by: LR | last post by:
Hi, I just installed visual studio .Net and everything was allright since à try to code in Form1.cs... The keys listed in subject line dont work. So I cannot make a line feed in my code ! What...
1
by: Sebastian Sosna | last post by:
Hello NG! Iam trying to write Access Control Settings for Users in Active Dir. First what i do is to delegate a Trustee in a Container, with permissions. This works fine. Lets take Guests as...
5
by: raagz | last post by:
Hi, I am using the .NET validation controls for validating . The validation works fine with IE but none of them work with Netscape 6 browser. Do i have to configure something in vS.NET to...
0
by: Alan Draper via .NET 247 | last post by:
I have the following code, which should show "No Cookie Set" the first time you visit, and then show the last time you visited each consecutive time. Should be simple, right... const string...
2
by: DougS | last post by:
I have a simple ASP.Net application, framework 1.1, sp1, VS2003. I cant set a session variable or a cookie. How can I tell if there is something wrong with my environment? Dim cookie As...
0
by: m3rajk | last post by:
i tried 'show databases;' and 'show database;' with NO response. i'm pretty sure it's the frist one that lists the databases on postgres sql and myssql i have used those two but work is using...
2
by: tasiekk | last post by:
I have 1 lil problem. I make simple Win Forms app and i put there a tab control. There i make two pages. In each page i make 1 button. In tabpage1 button1 and in tabpage2 button2. And i make access...
1
by: Guru | last post by:
I am creating a cookie when a person logs in which will keep track of the country the user is from. When I test it in the intranet environment a cookie is not created at all. But in an internet...
4
by: junee | last post by:
I tried to develop php on eclipse installed are prerequisites but it didn't work help me, if any one experienced with it succeeded. it is 0.7 build help plz
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...
0
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 project—planning, coding, testing,...
0
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...

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.