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

G

Guest

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)
}
 
D

David Jessee

After this executes, is there a Response.redirect? That can keep cookies
from saving

Simple Person said:
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);
}
 
G

Guest

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 said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cookies 0
Sessions and Cookies dont work 2
Cookies ... monster. Please help 3
cookies.... 1
problem with cookies and graphics 0
Cookies C# 3
problem with cookies 3
cookies 1

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top