Re: CGI::Session with MySQL Driver



Alexandre Jaquet <alexj@xxxxxxxxxxx> wrote in
news:429b00f5$0$1156$5402220f@xxxxxxxxxxxxxxx:

> A. Sinan Unur a écrit :
>> Alexandre Jaquet <alexj@xxxxxxxxxxx> wrote in
>> news:429af5eb$0$1145$5402220f@xxxxxxxxxxxxxxx:
>>
>>
>>>I've read this doc, but it's doesn't seem to have example with new
>>>defined field
>>>
>>>I want to store user_name in session table
>>
>>
>> <URL:
>> http://search.cpan.org/~sherzodr/CGI-Session-
3.95/Session/Tutorial.pm#
>> CREATING_NEW_SESSION>
>>
> nothing about storing data in database ...

How would you know? You did not read any of the documentation.

> $SESSION = new CGI::Session( "driver:MySQL", undef, { Handle =>$dbh}
> ); $SESSION->store($dbh,$SESSION->id,'',"user_name =>
> $username");

I cannot fathom where you got the idea that you should call the store
method on a CGI::Session object. There is no such method in the public
interface or documentation or even the source code of CGI::Session.

Now, CGI::Session::Driver::mysql does implement a store method, as do
all the drivers. But, that is not part of the public interface of a
CGI::Session::Driver::DBI. In fact, you are not supposed to manipulate
CGI::Session::Driver::DBI objects by yourself at all.

> what's wrong ?

You did not read the documentation.

Sinan

--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.



Relevant Pages

  • Re: casting question
    ... The documentation for the module the OP is using ... data must be mediated through that public interface. ... the message through the Body method. ... Sinan Unur ...
    (comp.lang.perl.misc)
  • Re: Help with sorting lists of lists
    ... > A. Sinan Unur wrote: ... >> documentation installed on your computer using this command from the shell ... >> on the command line. ... > The problem with perldoc is its lack of adequate searching. ...
    (comp.lang.perl.misc)
  • Re: Why isnt shift the same as $_[0]?
    ... Sinan Unur wrote: ... > documentation. ... it is listed in perldoc perltoot on "Planning for the Future: ... Better Constructors", so it should be some kind of known technique. ...
    (comp.lang.perl.misc)
  • Re: Division/math bug in perl?
    ... Sinan Unur wrote: ... > Might arrogant coming from someone who is unable to read and understand ... > the documentation: ... I have read earlier posts from others pointing out that your comments ...
    (comp.lang.perl.misc)
  • Re: request uri in CGI module
    ... Sinan Unur wrote: ... > Why not read the documentation? ... Actually I had a quick look at the docu and I searched it for "request uri" ...
    (comp.lang.perl.misc)