perlquestion
Cody Pendant
<p>
I recently had to create a website with user log-in and log-out etc and decided to Do It Properly and use <a href="http://search.cpan.org/~markstos/CGI-Session-4.13/">CGI::Session </a>instead of hacking my own stuff together.
</p>
<p>However, I'm a bit puzzled by a few things:</p>
<ol>
<li>Why is the <a href="http://search.cpan.org/~sherzodr/CGI-Session-3.95/Session/CookBook.pm">CGI::Session::Cookbook</a> no longer visible on the distribution page? It has one major error in it (arguments the wrong way around in the call to the <code>init()</code> sub) but on the other hand, it has a 'recipe' which exactly what I need for the user log-in situation. Has it become obsolete or deprecated in some way? I just used the suggested methods with version 4.13 of the module and everything seems fine.</li>
<li>Why is the current release labelled "UNAUTHORISED" in big red letters? That's a bit scary. Is there some kind of dispute between authors?</li>
<li>I can't find any reference in the pod or the Cookbook to a "remember me" session, i.e. the classic checkbox on a log-in form which means you don't have to log in next time. I solved this myself by inventing my own session param and putting: <code>
if($session->param('_REMEMBER')){
# set cookie with long expiry
}else{
# set default cookie which expires on browser close
}
</code>
but I was surprised to see that the idea doesn't even come up. Is this just a matter of fashions changing, and the "remember me" checkbox not being much used when the module was first written?
</li>
<li>Although there's a driver for saving sessions in a MySQL database, I was a bit surprised to find it just creates an entry with the session id as the primary key and a long string of text with everything else. It's hardly better than the default text-file method. You might as well use <code>dbmopen()</code> or a tied hash. I know you can create your own params, meaning the table would need to change, because I just did so, but surely it would be much more useful to create a proper table with all the vars in their own column? And if I need to tweak the object by adding my own params then I should be smart enough to add my own column?</li>
</ol>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-87399">
<HR>
<BR>
<blockquote>
Nobody says perl looks like line-noise any more<br>
kids today don't know what line-noise IS ...
</blockquote>
</div></div>