perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farouk Khawaja" <fkhaw...@Instinet.com>
Subject Session Management Magic
Date Fri, 28 May 2004 19:51:43 GMT
OK Folks,  I realize that sessions management is 'magic' but I really want
to know how it works. First some background

I've got session working with mySQL.  I can see the cookie in my browser and
it matches up with a record in the sessions table.

My table looks like so:
+-----------+-------------+------+-----+---------+-------+
| Field     | Type        | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| id        | varchar(32) |      | PRI |         |       |
| a_session | text        | YES  |     | NULL    |       |
| givenName | varchar(20) | YES  |     | NULL    |       |
+-----------+-------------+------+-----+---------+-------+

I have 2 test files, very simple and straight forward.  These work fine.

==================
- IN.html
   [- 
      $req = shift;
      $udat{givenName} = "john";
   -]

==================
- OUT.html
   [-
      $req = shift;
   -]
   [+ $udat{givenName} +]<br>
   [+ $udat{_session_id} +]
==================

However if I modify the files as described below, it also works and I don't
know why?  

NOTE: I haven't modified the table to add an additional field.

==================
- IN.html
   [- 
      $req = shift;
      $udat{givenName} = "john";
      $udat{surname} = "smith";
   -]

==================
- OUT.html
   [-
      $req = shift;
   -]
   [+ $udat{givenName} +]<br>
   [+ $udat{surName} +]<br>
   [+ $udat{_session_id} +]
==================

When I load IN.html and then OUT.html a second time, I get the value for
'surName', but I'm not sure where it's coming from?  Can anyone explain?

Thanks.


*****************************************************************
<<<Disclaimer>>>

In compliance with applicable rules and regulations, Instinet
reviews and archives incoming and outgoing email communications,
copies of which may be produced at the request of regulators.
This message is intended only for the personal and confidential
use of the recipients named above.  If the reader of this email
is not the intended recipient, you have received this email in
error and any review, dissemination, distribution or copying is
strictly prohibited. If you have received this email in error,
please notify the sender immediately by return email and
permanently delete the copy you received.  

Instinet accepts no liability for any content contained in the
email, or any errors or omissions arising as a result of email
transmission. Any opinions contained in this email constitute
the sender's best judgment at this time and are subject to change
without notice.   Instinet does not make recommendations of a
particular security and the information contained in this email
should not be considered as a recommendation, an offer or a
solicitation of an offer to buy and sell securities.

*****************************************************************


Mime
View raw message