views:

97

answers:

2

A site A (say url : www.a.com) is composed of different editions : each day a new edition. However, the site is not restful: the site is using cookies (I think) to save the edition the user wants onto access. So to access an article of a given edition, we have to first submit a form to specify the edition, and then get the articles of that edition. For my needs I have to use only one url to let the user access an article of a given edition ? is there a way to do it ?

A: 

If you want to figure out how the site is working, try accessing it with Firefox and Live HTTP Headers.

If you want us to figure out how it's working, give us the URL.

Jeremy Stein
Here is the site : http://www.liberte-algerie.com/archive.phpI haven't put the URL because it's in french :-)Thanks
massinissa
A: 

In a comment to my other answer, you gave the URL:

http://www.liberte-algerie.com/archive.php

When you access that page, you are given a php session (with the PHPSESSID cookie). The PHP application can then set session variables that will be associated with you for the duration of your session.

When you enter a date like "05/04/09" on that page and click the "Afficher" button, you are directed to this URL:

http://www.liberte-algerie.com/archive.php?date=05%2F04%2F09&Envoyer=Afficher&act_archive=ok

It appears that when that page is processed, the server is storing the date (passed in with the URL parameter) and associating it with your session. The date is not stored directly as a cookie in your browser. Rather, your session cookie links you to the session data on the server, which includes that date.

The page that is returned includes a snippet of Javascript:

<script language="JavaScript">
location.href = 'index.php';
</script>

This directs you to the index page (/index.php). This page apparently checks your session variables and uses the selected date to decide which articles to display.

You will continue to see those articles until you select another date, clear your session cookie, or your session expires.

Jeremy Stein
Thanks Jeremy for all these information !!!I guess the use have to access an article in a two steps process: 1. submit the edition date2. request an article of that edition
massinissa