DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Perl (http://www.daniweb.com/forums/forum112.html)
-   -   perl/Cookie... basic question (http://www.daniweb.com/forums/thread160699.html)

localp Dec 4th, 2008 8:54 am
perl/Cookie... basic question
 
i want to create a perl /CGI program Cookie, where the username can be remembered even if the browser is shut down and restarted. i am new to Perl programming, and i have no clue from where to start on this, but i am aware on how to set cookies, but when the browser is quit the saved values disappear..

so will some one plzzz help me with a sample code :( i am lost

KevinADC Dec 4th, 2008 1:53 pm
Re: perl/Cookie... basic question
 
Are you familiar with the CGI module? You can set and read cookies with the module. See the CGI documentation for details.

http://perldoc.perl.org/CGI.html#HTTP-COOKIES

There is also the CGI::Cookie module

localp Dec 4th, 2008 2:01 pm
Re: perl/Cookie... basic question
 
Quote:

Originally Posted by KevinADC (Post 750296)
Are you familiar with the CGI module? You can set and read cookies with the module. See the CGI documentation for details.

http://perldoc.perl.org/CGI.html#HTTP-COOKIES

There is also the CGI::Cookie module


i couldn't find any thing productive there..

wat i want to do is to create a perl persistent cookie ?? how do u code for this

KevinADC Dec 4th, 2008 5:45 pm
Re: perl/Cookie... basic question
 
There is no such thing as a perl cookie. On the server end they are generally refered to as sessions, on the client side, they are called cookies. But there is no such thing as a perl cookie so I am not sure what you are wanting to do.

mitchems Feb 5th, 2009 11:03 am
Re: perl/Cookie... basic question
 
Use an HTTP Cookie from the perl module mentioned above and set an expiration date into the future. That will store the cookie on the client's machine and it will retransmit it to your server. But storing the username is not a very secure solution.


All times are GMT -4. The time now is 6:36 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC