Re: CGI::Session with MySQL Driver



Fabian Pilkowski a écrit :
* Alexandre Jaquet schrieb:


Mark Clements a écrit :

Alexandre Jaquet wrote:

Mark Clements a écrit :

Alexandre Jaquet wrote:

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

Don't use store, use param.

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

Show us your code using param.


sub login {
    my $username = param('user_name');
    my $userpassword = param('user_password');


[...]


	$CGI::Session::MySQL::TABLE_NAME = 'session';
	my $SESSION = new CGI::Session( "driver:MySQL", undef, {Handle => $dbh} );
	@my_array = ("$username");
	$SESSION->param("user_name", \@my_array);


This creates a new session since the second param to new() is undef. The
param()-call should set the value for "user_name" in *this* session. It
seems to be all right.

How do you verify that this value is not saved in your session? Do you
look into the database by hand, don't you?

I assume your problem is to get back this session instead of creating a
new one each time your script is called. Could this be?

regards,
fabian

hi fabian, yes I look it by doing a sqlquery to verify, but the field user_name is alway empty


first I want to make my datas persistent into the db then I will check out if exising session can be reopended
.




Relevant Pages

  • Re: os users, sessions, and connections.
    ... From what I've read a session is a logged connection. ... do the following (paddr is the address of the process ... select sid, serial#, paddr, username from v$session ...
    (comp.databases.oracle.server)
  • Re: Get current logged-in user
    ... WTSClientBuildNumber ... Public Shared Function WTSQuerySessionInformation(ByVal hServer As ... UserName = ' This is were I dont know what to do! ... you would call WTSGetActiveConsoleSessionId to get a session ...
    (microsoft.public.dotnet.general)
  • loosing session value - sometimes
    ... into as sessionvariable (username). ... I save the recordid to the session and redirect to work.aspx. ... and I will change the username from manuel login to ...
    (microsoft.public.dotnet.security)
  • Re: Get current logged-in user
    ... you would call WTSGetActiveConsoleSessionId to get a session ... you would call WTSQuerySessionInformation with the WTSUserName ... The last one returns the domain/computer name along with the username; ...
    (microsoft.public.dotnet.general)
  • Re: question about more secure authentication
    ... when the username and password match the entries in the database, ... now, i've been reading about SESSION hijacking, etc and i'd like to ... make this login much more secure. ... more secure, use https: protocol. ...
    (alt.php)