Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-30-2009, 11:02 AM   #1
LQ Newbie
Registered: Jun 2009
Posts: 12

Rep: Reputation: 0
getting curl to destroy cookies

I need to access a website using curl

but when I visit the link a second time it thinks I have been there already and the form fields i want to fill in are not there.

how do i access the url with curl and dump and cookies it saved the previous time.

Old 11-30-2009, 12:03 PM   #2
Senior Member
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
I believe what you're looking for is the -j option. That should ignore the cookies it has stored.
Old 12-04-2009, 11:25 AM   #3
LQ Newbie
Registered: Jul 2009
Location: NE USA
Distribution: Slackware & Ubuntu
Posts: 5

Rep: Reputation: 0
Who took the cookies from the cookie jar?

You could always tell curl to store the cookies in a cookie jar and then delete that file. This would destroy the cookies and restore your "no cookie" state as before.

/temp$ curl -c ./jar1 -o bing.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 28781 100 28781 0 0 143k 0 --:--:-- --:--:-- --:--:-- 400k
/temp$ ls -tlr jar1 bing.html

-rw-r--r-- 1 dday dday 895 2009-12-04 12:22 jar1
-rw-r--r-- 1 dday dday 28781 2009-12-04 12:22 bing.html

spewed the contents of bing's home page into bing.html and left the cookies in jar1. You can now delete jar1 and start fresh.


curl, web

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cURL: Server has many IPs, how would I make a cURL script use those IPs to send data? guest Programming 0 04-11-2009 11:42 AM
destroy monitor? datbenik Linux - Hardware 1 12-07-2005 12:57 PM
Will it destroy my Monitor? chinaundead Linux - Hardware 9 04-01-2004 08:56 PM
c++ [Char serch + Destroy] Genjix Programming 1 11-09-2003 02:23 PM
I will destroy QT and all who follow it!!!! ciphercam Linux - Software 4 07-17-2003 12:33 AM

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration