473,785 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Managing multiple HTTP requests on same session

12 New Member
Hi,

I am trying to write a script that simulate a nevigation on a particular web site.
Before I am getting the page that contains the information I need, I have to go through a series of preceding pages.

The page flow is as follow: login page -> page1 -> page2 ..etc.

The problem is that once I am doing the login to the webside and requesting for the next page, the web server doesn't recongnize me anymore. The response I get is that the login has expired. Therefore I am not getting the actual html on this page and I cannot move forward to the next page in the flow.

I guess that the web server doesn't recognize two subsequent requests as coming from the same session.

I tried to use a few packages of perl: LWP:UserAgent, POE:Component:C lient:HTTP. Unfortunately, I couldn't solve that.

Do you have any idea ?

Thanks,
Ido.
Feb 21 '08 #1
2 2682
KevinADC
4,059 Recognized Expert Specialist
I am pretty sure WWW::Mechanize can do this as long as there is no javascript invloved. Read the documentation and read any FAQS or Cookbooks that are also posted/linked to on CPAN. I can not help with WWW::Mechanize usage as I have no experience with the module.
Feb 21 '08 #2
Kelicula
176 Recognized Expert New Member
Are you saving the cookies, that the remote site is sending you, and sending them back?
More than likely the remote site has sent you a cookie after the "login" page, which you're script will have to save and send back to the server, on all future request, just like a regular browser.

Here is an example server/client comm. with cookies.


Expand|Select|Wrap|Line Numbers
  1. client:
  2. GET www.somepage.com HTTP/1.1
  3. Host: localhost
  4. Accept: image/gif, image/x-bitmap, image/jpg, */*
  5. Connection: Keep-Alive
  6.  
  7. Server:
  8. HTTP/1.1 200 OK
  9. Date: Sat, 18 Mar 2008 20:35:35 GMT
  10. Server: Apache/1.3.9 (Unix)
  11. Set-Cookie: user_id=123456; path=/; expires=Sat, 18-Mar-05 19:06:19 GMT
  12.  
  13.  
  14. Then on all future request, client should echo:
  15. GET /somepage.html HTTP1.1
  16. Host: localhost
  17. Accept: image/gif, image/jpeg, */*
  18. Connection: Keep-Alive
  19. Cookie: user_id=123456
  20.  
  21.  
  22.  
Feb 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
7522
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I have an series of interactive HTML forms. The user begins a Cookie session. A database connection is opened and a transaction is begun. After the user goes through any number of pages where they update the database they finish on a page where...
1
8577
by: SPG | last post by:
Hi, I have a servlet application that I am trying to write a very basic load tester for. There application has several servlets, but all rely on the same session being used (IE: For logged in users etc). I am trying to write a little test app to test the workflow of the servlet application. The problem is I need to keep the same session alive and post via that session.
11
4975
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g., http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=Tidy7IDbDHA.2108%40cpmsftngxa06.phx.gbl) that indicate that ASP will queue up requests when they come in with the same "session".
0
1282
by: AIMTech | last post by:
We have an IIS+ASP based application server that is capable of providing complex reports to hundreds of users but in some circumstances these reports can take a long time to create. However the data for the report is cached so subsequent calls to view the same report come back with a sub-second response time. In order to make use of this caching we pre-prepare some of the reports by getting back a list of potential users from the server...
7
2161
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user using the application needs to see their own data only. My problem is that when multiple users are in the application, when in the session object, data is fine, however as there is only one instance of the class files, when data is put into them,...
18
3397
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site relies on subscrption fees. Sessions ID's are matched between the browser and the server. So a users can login with same username and password and those sessions are tracked individually. Some suggest create table fields with the session ID...
7
2542
by: blueapricot416 | last post by:
Hello helpful computer people! I can't seem to get more than one request to fire simultaneously... and I have read there should be at least 2 possible (in IE) and more in Firefox. I made a demo based on this article/code "Handling Multiple XMLHTTPRequest Objects" at http://www.drakware.com/articles/multijax.php, which does make mutliple requests, but never two seem to happen at the same time.
35
9365
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from 500000 to 3200000 of a file whose size is say 20MB... how do i request a download which starts directly at 500000th byte... thank u cheers
9
4269
by: mosscliffe | last post by:
I am struggling to find a python example of the scenario - I have. I have a python script, which generates a page with a search button (actually an input field). The data from the above submissions is interrogated and the same script produces a new search option and the a page of results from the previous search request. - as done by Google's Main search page. The user then has the option of a new search or navigating to a
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10327
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.