http

Implementation of "Remember me" in a Rails application.

My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. But sessions are implemented in Rails as session cookies, which are not persistent. I can make them ...

The Definitive Guide To Website Authentication

Form Based Authentication For Websites Please help us create the definitive resource for this topic. We believe that stackoverflow should not just be a resource for very specific technical questions, but also for general guidelines on how to solve variations on common problems. "Form Based Authentication For Websites" should be a fine t...

How to curl or wget a web page?

I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc. Unfortunately, I couldn't get the right set of cookies, etc, to make this work. Any ideas? Also, when the beta is finished, will my status page be a...

How can I make the browser see CSS and Javascript changes?

CSS and Javascript files don't change very often, so I want them to be cached by the web browser. But I also want the web browser to see changes made to these files without requiring the user to clear their browser cache. Also want a solution that works well with version control system such as Subversion....

How do I best detect an ASP.NET expired session?

I need to detect when a session has expired in my Visuial Basic web application. This is what I'm using... Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If CurrentSession.IsNew AndAlso (Not Page.Request.Headers("Cookie") Is Nothing) AndAlso (Page.Request.Headers("Cookie").IndexOf("ASP.N...

HTTP: How to know when to send a 304 Not Modified response

I'm writing a resource handling method where I control access to various files, and I'd like to be able to make use of the browser's cache. My question is two-fold: Which are the definitive HTTP headers that I need to check in order to know for sure whether I should send a 304 response, and what am I looking for when I do check them? ...

HTTP: Generating ETag Header

How do I generate an ETag HTTP header for a resource file? ...

Accessing post variables using Java Servlets

The title says it all. All I really want is the equivalent of PHP's $_POST[], and after searching the web for an hour, I'm still nowhere closer....

HTTP Libraries for Emacs

I recently discovered the org-mode in emacs and it works very well for me. I also like www.RememberTheMilk.com. I would like to be able to sync my org-mode file and RTM list. I know that RTM has its API exposed as web services. I am currently looking for a HTTP library that I could use to write my script. I found a couple of links but I ...

Checking FTP status codes with a PHP script.

I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server status code from servers other than HTTP servers. How can I f...

How do I stop IIS7 dropping my cookies?

I'm using Windows Vista x64 with SP1, and developing an ASP.NET app with IIS7 as the web server. I've got a problem where my cookies aren't "sticking" to the session, so I had a google and found that there was a known issue with duplicate response headers overwriting instead of being added to the session. This problem was, however, suppo...

What is the best way to upload a file via an HTTP POST with a web form?

Basically, something better than this: <input type="file" name="myfile" size="50"> First of all, the "browse" button looks different on every browser. Unlike the "submit" button on a form, you have to come up with some hack-y way to style it. Secondly, there's no progress indicator showing you how much of the file has uploaded. ...

How do I convert a date to a HTTP-formatted date in .Net / C#

How does one convert a .Net DateTime into a valid HTTP-formatted date string? ...

Best way to let users download a file from my website: http or ftp

We have some files on our website that users of our software can download. Some of the files are in virtual folders on the website while others are on our ftp. The files on the ftp are generally accessed by clicking on an ftp:// link in a browser - most of our customers do not have an ftp client. The other files are accessed by clicking ...

Reading "chunked" response with HttpWebResponse

I'm having trouble reading a "chunked" response when using a StreamReader to read the stream returned by GetResponseStream() of a HttpWebResponse: // response is an HttpWebResponse StreamReader reader = new StreamReader(response.GetResponseStream()); string output = reader.ReadToEnd(); // throws exception... When the reader.ReadToEnd(...

How would you implement FORM based authentication without a backing database?

I have a PHP script that runs as a CGI program and the HTTP Authenticate header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored. I am very open to having a master username and password. I just need to protect the a...

Process raw HTTP request content

I am doing an e-commerce solution in ASP.NET which uses PayPal's Website Payments Standard service. Together with that I use a service they offer (Payment Data Transfer) that sends you back order information after a user has completed a payment. The final thing I need to do is to parse the POST request from them and persist the info in i...

How do I use NTLM authentication with Active Directory

I am trying to implement NTLM authentication on one of our internal sites and everything is working. The one piece of the puzzle I do not have is how to take the information from NTLM and authenticate with Active Directory. There is a good description of NTLM and the encryption used for the passwords, which I used to implement this, but...

Database query representation impersonating file on Windows share?

Is there any way to have something that looks just like a file on a Windows file share but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simple HTTP-based service to serve the content of the files dynamically to pick up real ti...

What would be a good, windows and iis (http) based distributed version control system

At my job we make & sell websites. Usually we install our .NET C# based site on a customer's server and maintain and support it remotely. However, every once in a while, for bigger development works and just to make things simpler (and faster!), we will copy the site to a local server. This is great, but has one pain - moving the site b...