toniax has asked for the wisdom of the Perl Monks concerning the following question:

Thank you everyone for all your help



Hello,
Does anyone know where to find good information and example
code on creating cookies without using CGI?

Replies are listed 'Best First'.
Re: cookie ssss
by moritz (Cardinal) on Nov 27, 2010 at 16:41 UTC
    CGI::Cookie can (to the best of my knowledge) even be used if you don't use CGI to communicate between your script and the web server.

    Its documentation also contains example code. For more specific examples you should tell us first how you want to talk to your web server.

      noitamrofni resworb dna pi
      sresu eht seveirter taht eikooc cisab a etaerc ot tnaw I

        "I want to create a basic cookie that retrieves the users ip and browser information"

        Errrrr.... perhaps you should Google for "cookie" and ("faq" or "tutorial") or something similar. Using a cookie for your purposes sounds a lot like using a backhoe to put sugar in your tea. It can be done, but it's certainly the hard way. Customarily, cookies are used for session identification (benign) or tracking (often not benign).

        The information you're seeking is probably already in your server's log files; it's also readily obtained with a trivial script (IIRC, there's such a script here; a little Super Searching should let you find it -- which is my copout for 'sorry, no link because I didn't find it with a cursory search.'

        Backtracking now, to your update of your initial question: see answer beginning with "Errrr." Re creating cookies without using CGI, as moritz said, there are ways to do so... but from your Re^2: cookie ssss, that doesn't sound like the way to do it. So -- again -- before you put a lot of effort into creating cookies, read about their use... and read about how to collect information in visitors' ips and browswers.

Re: cookie ssss
by Anonymous Monk on Nov 27, 2010 at 19:27 UTC