I found that trying to persist my users id using a session variable doesnt work when the user is taken to paypal and returns. OK - so I set a cookie when the user is going to go to paypal. IE9 recognizes the cookie but Google chrome ignores it, ??But it
has my webaddress listed in it's advanced settings. Is there something different with chrome? I aded the label to display the value of the cookie. IE shows it, Chrome is blank. After memberid is assigned I intentionally kill the cookie.
if (!IsPostBack)
{
HttpCookie _userInfoCookies = Request.Cookies["UserID"];
string strcookie = "";
if (_userInfoCookies != null)
{
strcookie = _userInfoCookies["UserID"];
memberid = Convert.ToInt32(strcookie);
lblTest.Text = "cookie: " + strcookie;
//HttpCookie _userInfoCookies = new HttpCookie("UserID");
//Adding Expire Time of cookies before existing cookies time
_userInfoCookies.Expires = DateTime.Now.AddDays(-1);
//Adding cookies to current web response
Response.Cookies.Add(_userInfoCookies);
Thearotically there should not be any problem. Can you try accessing your code from some other machine? Also try to access the webpage in safari browser see if it's showing the label.
If above tests shows the label text then there is some cookie related seeting in your chrome which needs to be changed. You will easily find that on google...
Marked as answer by Mark - MSFT on Jan 21, 2013 02:25 AM
dieseldave
Member
384 Points
432 Posts
cookies in chrome??
Jan 10, 2013 11:50 AM|LINK
I found that trying to persist my users id using a session variable doesnt work when the user is taken to paypal and returns. OK - so I set a cookie when the user is going to go to paypal. IE9 recognizes the cookie but Google chrome ignores it, ??But it has my webaddress listed in it's advanced settings. Is there something different with chrome? I aded the label to display the value of the cookie. IE shows it, Chrome is blank. After memberid is assigned I intentionally kill the cookie.
if (!IsPostBack) { HttpCookie _userInfoCookies = Request.Cookies["UserID"]; string strcookie = ""; if (_userInfoCookies != null) { strcookie = _userInfoCookies["UserID"]; memberid = Convert.ToInt32(strcookie); lblTest.Text = "cookie: " + strcookie; //HttpCookie _userInfoCookies = new HttpCookie("UserID"); //Adding Expire Time of cookies before existing cookies time _userInfoCookies.Expires = DateTime.Now.AddDays(-1); //Adding cookies to current web response Response.Cookies.Add(_userInfoCookies);Tanmay.in
Member
34 Points
16 Posts
Re: cookies in chrome??
Jan 15, 2013 12:02 PM|LINK
Thearotically there should not be any problem. Can you try accessing your code from some other machine? Also try to access the webpage in safari browser see if it's showing the label.
If above tests shows the label text then there is some cookie related seeting in your chrome which needs to be changed. You will easily find that on google...