Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Problem Deleting Session



******    message to minivend-users from "Cameron B. Prince" <cbp@InternetExpertsLLC.com>     ******

Hello,

I have added the following code to my receipt page in an attempt to delete
the customer's session once the sale is complete.

RECEIPT.HTML

[set name=done int][userdb function=logout clear=1][/set]
[if scratch done]
<TABLE WIDTH="97%" BORDER=0 CELLPADDING=4 CELLSPACING=4 align="center">
<tr><td><font face="verdana" size="2">
For security purposes, you have been logged off of our system. You order and
payment information
has been encrypted and securely sent to our office for processing. All
client payment information has
been removed from the Internet Experts L.L.C. server.
</font>
</td></tr>
</table>
[perl arg=sub interpolate=1]ClearSession("[data session id]")[/perl]
[else]
<TABLE WIDTH="97%" BORDER=0 CELLPADDING=4 CELLSPACING=4 align="center">
<tr><td><font face="verdana" size="2" color="#ff0000">
An error ocurred while attempting to automatically log you off our system.
For security reasons you
should close all browser windows to fully exit from our web site.
</font>
</td></tr>
</table>
[/else]
[/if]


GLOBAL SUB IN MINIVEND.CFG

GlobalSub <<EOF
sub ClearSession {
my $session_id = $_[0];
my $basepath = '/var/lib/minivend/iellc/session/';
$session_id =~ m/(\w)(\w)/;
my $firstchar = $1;
my $secondchar = $2;
my $complete_path =
$basepath.$firstchar."/".$secondchar."/".$session_id."*.*";
print `rm -rf $complete_path`;
return $complete_path;
}
EOF


Once a sale is made and the receipt page is shown, the user is successfully
logged out. My problem is the global sub is removing the session lock file,
but not the session file itself. I have used the most direct syntax I know
of to delete all the files and my fear is that at the same time I am
attempting to delete the file, MV has it open writing stuff to it, so it
can't be deleted.

I have seen list members mention using scripts to delete the session, but no
code was provided.

Can anyone tell me what I need to change here to make it wait till MV has
closed the session before trying to delete the files?

Thanks,

Cameron




-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: