httpcookie

Convert Google Analytics cookies to Local/Session Storage

早过忘川 提交于 2019-11-27 04:15:53
问题 UPDATE http://jsfiddle.net/musicisair/rsKtp/embedded/result/ Google Analytics sets 4 cookies that will be sent with all requests to that domain (and ofset its subdomains). From what I can tell no server actually uses them directly ; they're only sent with __utm.gif as a query param. Now, obviously Google Analytics reads, writes and acts on their values and they will need to be available to the GA tracking script. So, what I am wondering is if it is possible to: rewrite the __utm* cookies to

Is it possible to set a cookie during a redirect in ASP.NET?

妖精的绣舞 提交于 2019-11-26 23:10:53
问题 I am using ASP.NET. I either add or set a cookie (depending on whether the HttpRequest contains a cookie with specified key), and immediately afterward call Response.Redirect . The cookie is not set. Is this correct behavior? Is there something mutually exclusive about setting a cookie during an http response with a 302 status code? Here's the source: if (context.HttpContext.Request.Browser.Cookies) { var cookies = context.HttpContext.Request.Cookies; var stateCookie = new HttpCookie(SR

CookieManager for multiple threads

独自空忆成欢 提交于 2019-11-26 20:46:09
问题 I am trying to make multiple connections via threads. But every connection seems to override the other's cookies, resulting in the connections using the wrong cookies. inside the threaded class's constructor: manager = new CookieManager(); manager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); CookieHandler.setDefault(manager); Any way to manage the cookies per thread or per class? New failed try: Now every thread is using it's own index, yet they still seem to override each other cookie-wise. Any

Cookie path and its accessibility to subfolder pages

霸气de小男生 提交于 2019-11-26 18:43:06
Let say I have a website with domain: www.example.com If I set a cookie with path ' / ' the cookie will be accessible via all pages in the domain, eg: www.example.com/page1.html www.example.com/subfolder1/page1.html www.example.com/subfolder1/moresubfolder1/page1.html, etc. What if we set the cookie to path ' /subfolder1 ', will the cookie will be made available to any page or subfolder beneath the folder? Eg: www.example.com/subfolder1/moresubfolder/page1.html So, if not, I guess, I have no choice but to use path '/' for those cookies, right? Alex Barrett If we set the cookie to path '

Using Cookie in Asp.Net Mvc 4

杀马特。学长 韩版系。学妹 提交于 2019-11-26 12:24:40
问题 I have web application in Asp.Net MVC4 and I want to use cookie for user\'s login and logout. So my actions as follows: Login Action [HttpPost] public ActionResult Login(string username, string pass) { if (ModelState.IsValid) { var newUser = _userRepository.GetUserByNameAndPassword(username, pass); if (newUser != null) { var json = JsonConvert.SerializeObject(newUser); var userCookie = new HttpCookie(\"user\", json); userCookie.Expires.AddDays(365); HttpContext.Response.Cookies.Add(userCookie

Cookie path and its accessibility to subfolder pages

僤鯓⒐⒋嵵緔 提交于 2019-11-26 06:35:28
问题 Let say I have a website with domain: www.example.com If I set a cookie with path \' / \' the cookie will be accessible via all pages in the domain, eg: www.example.com/page1.html www.example.com/subfolder1/page1.html www.example.com/subfolder1/moresubfolder1/page1.html, etc. What if we set the cookie to path \' /subfolder1 \', will the cookie will be made available to any page or subfolder beneath the folder? Eg: www.example.com/subfolder1/moresubfolder/page1.html So, if not, I guess, I have