My work's VPN requires me to first login to a website, get a specific cookie and then pass that to the vpn software (This Juniper VPN if anyone is wondering and I'm using Linux).

I don't want to have to go searching through Firefox's preferences to find by hand find the cookie I need. I thought I'd use perl to read cookies.txt, but of course there doesn't seem to be a cookies.txt any more.

I then played around with sqlite3 (getting DBD::SQLite working was also a pain). It seems the cookie isn't actually saved to the file but is only in some active memory or something. I can find it in Firefox in the list of all cookies. There are also some cookies specific to our domain that are in both the file and while the browser is open. So something does get saved just not the specific cookie I need.

Any idea how I might go about retrieving this cookie? I'm willing to switch browsers if that might help. There's also something on github that tries to screen scrape the vpn website and capture the cookie from there, but it doesn't at all work with the site I have to log into. If I'm going about this (the vpn login) totally wrong let me know ideas on that too.

Thanks in advance.


In reply to Reading a cookie from an active browser session by xorl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.