r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Dockimbel
8-May-2011
[10401]
Never saw such error before.
onetom
8-May-2011
[10402]
the html error page says: Redirection Trapped
Dockimbel
8-May-2011
[10403]
Means a 30x HTTP code was returned by the request.
onetom
8-May-2011
[10404x2]
needless to say i've created both app-init.r files for the sake of 
the experiment w a content of REBOL[] but im still getting the error
why is it giving me an error page? because of the debug option in 
the config file or because of the -vvvv?
Dockimbel
8-May-2011
[10406]
'debug keyword is producing error pages.
onetom
8-May-2011
[10407x2]
ok, it's the debug
the funny thing is im trying to "debug" from the command line and 
i have to login to the app 1st but if the debug flag is on, im getting 
back and error page and multiple session cookies
Dockimbel
8-May-2011
[10409]
Multiple?
onetom
8-May-2011
[10410]
Cookie	{RSPSID=YVCBKGUZKHKSJGXVCBSTYDIK; RSPSID=YARKPZJMKJUNWDZRFOLUKJTE}
login	"test"
pass	"letmein"
Session ID	"YARKPZJMKJUNWDZRFOLUKJTE"
Dockimbel
8-May-2011
[10411]
Remember that you can add debug/off at any time to any page.
onetom
8-May-2011
[10412]
ok, i will try that, thx
Dockimbel
8-May-2011
[10413x2]
I guess these 2 sessions ID are coming from 2 different webapps.
Have you tried to define a webapp inside another webapp?
onetom
8-May-2011
[10415]
no, i have 1 webapp only now, but let me try in an incognito window
Dockimbel
8-May-2011
[10416]
Nested webapps are not supported, the resulting behaviour is undefined.
onetom
8-May-2011
[10417x2]
i was merging multiple webapps under the same vhost, so it mush have 
been some leftover stuff
any example how do u test pages behind a session?

im trying curl -D- -d 'login=test&pass=letmein' -c jar http://localhost:8080/app/login.rsp

but subsequent curl -D- -c jar http://localhost:8080/app/some.html 
still gives me 302 to login.rsp
GrahamC
8-May-2011
[10419]
only session variables are safe?  I must have missed that in the 
docs!
onetom
8-May-2011
[10420]
i'd be interested in looking into the sessions during runtime too.. 
can i do it on the cheyenne console by pressing escape?
Dockimbel
8-May-2011
[10421x2]
any example how do u test pages behind a session?

 You shouldn't use AUTH keyword if you don't want the redirection 
 to a login page.
GrahamC: I think it should be explained in the new wiki pages.
onetom
8-May-2011
[10423]
Dockimbel: i want the authentication. im just asking how can i test 
it programmatically easily. any idea whats wrong w the curl command 
lines?
Dockimbel
8-May-2011
[10424x2]
i'd be interested in looking into the sessions during runtime too.. 
can i do it on the cheyenne console by pressing escape?
You can access them in 3 different ways:


1) if run from sources, escape in the console, then enter: probe 
uniserve/services/httpd/mod-list/mod-rsp/sessions/queue. Type do-event 
when you want to resume Cheyenne.


2) run the %clients/rconsole.r from the source archive, you will 
have a remote console connected to your local Cheyenne process (try 
on prompt: netstat)


3) add this to the config file in globals section: persist [sessions]. 
When you want to look to the sessions, just stop Cheyenne process, 
a .rsp-sessions file is created holding the session objects.
onetom: sorry, I am not fluent in curl, I need to look for man pages 
for every options...Can't you use REBOL http client for testing?
onetom
8-May-2011
[10426x2]
sure, i can use. i was asking for an example as i how do u do it 
usually
i saw u r using rebol mostly, so i was expecting some rebol example
Dockimbel
8-May-2011
[10428]
Does curl handle cookies automatically?
onetom
8-May-2011
[10429x2]
thats whats -c is for
it maintains cookies in a jar
Dockimbel
8-May-2011
[10431]
Have you looked into the request/response logs from Cheyenne?
onetom
8-May-2011
[10432x4]
thats what im not sure how to handle w a little code in rebol, that's 
why i was asking u; thought u need have some examples in ur toolbox
yes, it's not sending the cookie as i would expect on the 2nd run
$ cat jar
# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.


#HttpOnly_guan-huat     FALSE   /       FALSE   0       RSPSID  MTXVGMVOMYMVGDZKFURKPQKK
i will read up on curl, im just asking how would YOU do it from rebol
Dockimbel
8-May-2011
[10436x2]
You should try to send a GET request first on the login.rsp page.
I'm using either REBOL HTTP client for testing or my own HTTP async 
client (using UniServe) that can handle cookies. But I never need 
to test my webapps programmatically (at least not so far).
onetom
8-May-2011
[10438]
okay, thx
Dockimbel
8-May-2011
[10439x2]
When I need to debug an HTTP communication, I either look into Cheyenne 
reques/response logs or I use firebug.
Here how it goes with REBOL native HTTP client: http://piratepad.net/KkvkZ9AtME
 (see at bottom)
onetom
8-May-2011
[10441]
my bad. seems like i should use -b to read the cookies. -c just writes 
them...
Dockimbel
8-May-2011
[10442]
You should stick with REBOL HTTP client, using this patch to add 
transparent cookie support: http://www.rebol.org/view-script.r?script=my-http.r
onetom
8-May-2011
[10443x4]
i think i was using that once. it's just not default in rebol... 
:/ curl however is present on every machine i have access to...
so it's worth learning.

i was a wget user earlier, but since macs come w curl and i can easily 
apt-get install curl and even syllable comes w curl, i don't give 
a fuck anymore how an inefficient bloatware is curl, im still trying 
to use it and only it :)
my-http is nice though. i wish there would be a guide for all these 
protocol extensions.. there are a couple of half-baked versions of 
them... :/
curl -D- -d 'login=test&pass=letmein' -c jar http://localhost:8080/login.rsp
curl -D- -b jar -c jar http://localhost:8080/some.html
worked, btw
Dockimbel
8-May-2011
[10447]
Curl is not on Windows, REBOL is.
onetom
8-May-2011
[10448]
http://curl.haxx.se/download.html
Dockimbel
8-May-2011
[10449]
Protocol extensions: right, they could have been listed somewhere 
on REBOL web sites.
onetom
8-May-2011
[10450]
it's actually available for a lot more platforms than rebol nowadays