472,139 Members | 1,636 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 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 1141
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sebastian Sosna | last post: by
reply views Thread by Alan Draper via .NET 247 | last post: by
2 posts views Thread by DougS | last post: by
2 posts views Thread by tasiekk | last post: by
4 posts views Thread by junee | last post: by

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.