Re: CGI::Session with MySQL Driver



Mark Clements a écrit :
Alexandre Jaquet wrote:


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.p
m#CREATING_NEW_SESSION>


nothing about storing data in database ...

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

store now return : Can't use string
("b7f26a2095fb2ff4e11e8ae1295d767e") as an ARRAY ref while "strict
refs" in use at ...

the string b7f26a2095fb2ff4e11e8ae1295d767e represent the sessionid
what's wrong ?


You really don't read the documentation do you?

From the tutorial that Sinan pointed you at:

         @my_array = ("apple", "grapes", "melon", "casaba");
         $session->param("fruits", \@my_array);

Don't use store, use param.

Don't make us read the docs for you.

Mark

That's what I've try first it's doesn't store value key pair user_name $username ...
.




Relevant Pages

  • Re: CGI::Session with MySQL Driver
    ... Mark Clements a écrit: ... You can then check in the db table directly to see if the session has been stored. ... if (!$dbh) kill 9, ...
    (comp.lang.perl.misc)
  • Weird PropertyBag problem, values wont change
    ... CSession - Data storage class for a session. ... CSessions - Collection of CSession objects for all logged in users. ... Public Property Let ID(ByVal vData As String) ... Public Sub Remove ...
    (microsoft.public.vb.controls)
  • server-side JavaScript: Prototypes of built-in classes, objects and functins
    ... Session object (disk-based session variables for data persistence ... File class (manipulation of files on server, ie. open, close, read, ... //Methods Cgi.queryCgi.postCgi.anyby default return an empty string if requested var not found ...
    (comp.lang.javascript)
  • Calling a public function to email a report
    ... Public Sub SendNotesMail(Subject As String, Attachment As String, ... Dim UserName As String 'The current users notes name ... Dim Session As Object 'The notes session ... Set Maildb = Session.GETDATABASE ...
    (microsoft.public.access.modulesdaovba)
  • Re: Repeater paging problem
    ... First about your "authentication". ... The way things should be done: Create checkboxes inside ... your comma separated string property will already be ready when your ... Doing it this way, you won't need no Session variable, no iteration thru ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)