Hello Monks, Here is code which already exists can you tell me how can I add the cookie when user changes some information in his session. As you Can see the script it does some calls to db and reloads the page setting the cookie if I want to add some value to $sessionInfo variable and change only that value i cannot. please tell me how to proceed ?
sub setCookie { use CGI qw(:standard); local $username = shift; local $password = shift; local $path = shift; my $sProjName = shift; local($sessionInfo, @UserInfo, $sql, $rec, $value, $iUID, $sUNAME, $iTID, $sTNAME,$iEID, $sENAME, $rc); my $sWorkbenchDSN; # Using the project name, retrieve the proper ODBC datasource name + from the INI file. $sWorkbenchDSN = &getIniKeyValue($sProjName, "dsn", $WB_INI_FILENA +ME); $DBUserName = $username; ##Rel 3.3 - PIM 19986 $username = removeSpecialChar($username); if ($username, $password) ## checks for username and password { local ($error); $error = ""; my $db = OpenDatabaseConnection($sWorkbenchDSN); ### Query User ID and Password $sql = qq| SELECT M.MemberID, M.MemberName, M.PrimaryTeamID, T.TeamName, M.PrimaryEventID, E.EventName, M.PrimaryAreaID, A.AreaName, M.ExpDate FROM tblMember M, tblTeamMember TM, tblTeam T, tblEvent E, tblArea A WHERE M.MemberID = TM.MemberID AND M.PrimaryTeamID = T.TeamID AND M.PrimaryEventID = E.EventID AND M.PrimaryAreaID = A.AreaID AND M.Status != 'INACTIVE' AND M.MemberName = '$username' AND M.Password = '$password'; |; my $sth; # Prepare SQL statement unless($sth = $db->prepare($sql)) { $error = 1; $sth->finish; $db->disconnect; &login($path, $error); exit; } # Execute the SQL statement $rc = $sth->execute; # Check to see if username and password are correct if ($rc != -1) { ########################################################## +################## ## level 2 admin ########################################################## +################## ### Query User ID and Password $sql = qq| SELECT M.Status FROM tblMember M WHERE M.MemberName = '$username' AND M.Password = '$password'; |; my @User = &executeSQLStatement($sql); if ($User[0] eq 'ACTIVELEVEL2') { $sessionInfo = "$iUID|ADMIN|0|0|0|0|" . "0|0|$sWorkbenchDSN|$sProjName"; ### If user's password is default (password), force ch +ange if (($password eq 'PASSWORD') || ($password eq 'passwo +rd')) { $sth->finish; $db->disconnect;

20040722 Edit by castaway: Changed title from 'cookies'


In reply to Setting cookies on session data change by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.