[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using curl/wget to call logout



On Fri, Jul 15, 2016 at 05:40:40AM +0000, Bob wrote:
> I'm trying to use curl to call the logout function of a logout button
> already working through browser.
snip
> already tried with
> 
> curl -c my.cookie  <link>/home.jsp
> curl -X GET -c my.cookie <link>/Login.jsp?message=logout
> 
> but no success. How can I use curl/wget to logout through CLI ?

It would be helpful if instead of 'no success' you provided precisely what
did happen and what output/return code you got.

The problem here, or really the behaviour you are asking questions about, is
specific to whichever device you are trying to interact with, and is not really
a wget question. Without knowing the device, there's little we can do to help
you.

You might need to set HTTP Auth headers for the wget request. If that were the
case, the result of trying without would indicate that authentication was
required.

Cloning the session cookie from your browser won't work; the session management
code in your device is designed to prevent you doing that. You will likely need
to initiate a new session from a script, and use the cookie /that/ process sets
for the request to press the poweroff button.

You could try getting wget to set the referrer, you could also try asking wget
to use the same User-Agent string as your browser.


-- 
Jonathan Dowland
✎ jon@dow.land
🔗 jmtd.net

Please do not CC me, I am subscribed to the list.

Attachment: signature.asc
Description: Digital signature


Reply to: