cookies

How do I send cookies to the client via a socket with C#?

Ok, if I have this right, my code can get cookies at a specific url, but then once I get the cookie, into the container, how can I send it to the client via socket? Like the code directly below does here for regular http-page requests. byte[] buffer = new byte[bz]; rebu = responsestream.Read(buffer, 0, bz); while (rebu != 0) { soket...

JavaScript bookmarklet to delete all cookies within a given domain

Hello Everyone, I am testing a web app that writes cookies to subdomain.thisdomain.com and several subfolders within that. I'm looking for JavaScript that I can put into a bookmarklet that will delete all cookies under that subdomain, regardless of the folder in which they exist. Any ideas? ...

IE8 loses cookies when opening a new window after a redirect

I'm using Internet Explorer 8 beta 2. Client performs POST on http://alpha/foo Server responds with redirect to http://beta/bar Client performs GET on http://beta/bar Server responds with redirect to http://beta/baz and sets cookie Client performs GET on http://beta/baz including cookie Server provides response User selects "Open in ...

Clearing all cookies with javascript

How do you delete all the cookies for the current domain using javascript? ...

WatiN test using IE.GetCookie failing only from CruiseControl

I added some simple WatiN tests to our app today to check that a cookie value is stored correctly. The tests pass locally on all machines in the team. However, when CruiseControl runs the tests on our Build server these new tests fail on the line containing browser.GetCookie(url, cookieName) The error given in the CruiseControl log is...

How to use Python to login to a webpage and retrieve cookies for later usage?

Hi! I want to download and parse webpage using python, but to access it I need a couple of cookies set. Therefore I need to login over https to the webpage first. The login moment involves sending two POST params (username, password) to /login.php. During the login request I want to retrieve the cookies from the response header and stor...

ASP.NET cookie expiration time is always 1/1/0001 12:00 AM

I'm setting the cookie expiration using the following code: // remove existing cookies. request.Cookies.Clear(); response.Cookies.Clear(); // ... serialize and encrypt my data ... // now set the cookie. HttpCookie cookie = new HttpCookie(AuthCookieName, encrypted); cookie.Expires = DateTime.Now.Add(TimeSpan.FromHours(CookieTimeOutHo...

How do I remove a cookie that I've set on someone's computer?

I've got a web system where users log in, and it stores a cookie of their session. When they log in as someone else or log out I want to remove that original cookie that I stored. What's the best way to do that? I'm using Python and Apache, though I suppose the answer will remain the same for most languages. ...

ASP.NET: Popup browser windows and session cookies

SUMMARY: When browsing an ASP.NET website using Windows Explorer, popup windows do not "borrow" the session cookie from the parent window. DETAILS: I'm working on an ASP.NET website (.NET Framework 2.0). I use FormsAuthentication. It is a requirement to use cookies to handle the session. On a page I have a button. When the user clicks...

WCF client consuming multiple asmx service that uses HTTP Cookies

I am trying to use the same http cookie (in effect a asmx sessionid), in multiple WCF client endpoints. The server has several endpoints, one of them is: AuthenticationService.asmx Login() <- Creates a HTTP cookie that is the servers ASP.NET sessionid Logout() <- Destroys the same cookies SomeOtherService.asmx DoSome...

Sharing ASP.NET session cookies with a Java applet

I have a Java applet that runs inside a forms-authenticated aspx page. In the .NET 1.1 version of my site, the applet has access to the session cookie and is able to retrieve a file from the server, but in the .NET 2.0 version it fails to authenticate. I have seen a couple of forum posts elsewhere that state that 2.0 sets cookies to Htt...

Cookie loses value in ASP.net

I have the following code that sets a cookie: string locale = ((DropDownList)this.LoginUser.FindControl("locale")).SelectedValue; HttpCookie cookie = new HttpCookie("localization",locale); cookie.Expires= DateTime.Now.AddYears(1); Response.Cookies.Set(cookie); However, when I try to read the cookie, the Value is Null. The coo...

Best way to determine if cookies are enabled in ASP.NET?

What is the best method for determining if a users browser has cookies enabled in ASP.NET ...

Cross Domain User Tracking

We have several websites on different domains and I'd like to be able to track users' movements on these sites. Obviously cookies are not feasable, because they don't cross domain borders. I could look at a combination of IP address and User Agent, but there are some cases where that does not work. I don't want to use flash or other p...

How do I uniquely identify computers visiting my web site?

I need to figure out a way uniquely identify each computer which visits the web site I am creating. Does anybody have any advice on how to achieve this? Because i want the solution to work on all machines and all browsers (within reason) I am trying to create a solution using javascript. I appreciate the help. Thanks. ...

Rails Cookie Setting Problems

I have a Rails app that sets a cookie and does a redirect to another server once the user is logged in. However, the cookie that the Rails app sets isn't seen by the server for some reason. I've tried setting http_only to false but I still can't even see the cookie unless the domain is the same as my Rails app. Here's the code I'm using ...

Is it possible for a XSS attack to obtain HttpOnly cookies?

Reading this blog post about HttpOnly cookies made me start thinking, is it possible for an HttpOnly cookie to be obtained through any form of XSS? Jeff mentions that it "raises the bar considerably" but makes it sound like it doesn't completely protect against XSS. Aside from the fact that not all browser support this feature properly,...

Apache MOD_REWRITE Domain Level Cookie

I need to deal with Affiliate Tracking on our website. In our .htaccess we have: RewriteCond %{QUERY_STRING} affiliate=(.*) RewriteRule ^(.*)$ $1? [NC,R,L,co=AFFID:%1:%{HTTP:Host}:7200:/] Which creates a COOKIE called AFFID with the value of the URL Parameter affiliate. But the Cookie is not for the whole domain, i.e. Going to http...

How do I stop users circumventing payment?

Hi I have a site that uses paypal to collect payments for electronically displayed data. Variables can't be passed with the URL through paypal (or I can't get them to work) so I have used cookies to pass the item number. However, a crafty user could, after the cookie writing part, enter the paypal redirect URL directly into the address ...

What is the best way to implement "remember me" for a website?

I want my website to have a checkbox that users can click so that they will not have to log in each time they visit my website. What is the best way to implement this? I know I will need to store a cookie on their computer, but what should be in it? Is there anything I need to watch out for to keep this cookie from presenting a securi...