On Fri, 22 Jun 2007, Raymond Wan wrote:
> Hi all,
>
> I'm having a problem figuring out how to do authorization. Suppose a
> user logs in and has an access level of "10". How do I keep this
> information from one request to another?
>
> Recently, there was a discussion here about $m -> notes(), but it is per
> request... I presume that means if the user goes first to index.html,
> logs in, and then goes to one.html, index.html (and all subcomponents
> that it calls) will know about it but when the user goes to one.html,
> another request is made and this information is gone.
>
> Currently, I've made the user's logged-in level as a global variable but
> that isn't working. Sometimes it works and other times (usually when I
> wait a bit before clicking "one.html") it won't. I think this happens
> because after waiting a bit, the request gets handled by another Perl
> interpreter which has no knowledge of this global variable.
>
> So, is there a way to keep this information between user requests or is
> my only option to set a cookie on the client side?
Yes, and sort-of-yes :).
I'm using CGI:Session to keep the users' details. But I give the user
a cookie, which then links them to the session. It's also possible to pass a
variable with the session ID around between requests, but this is more hassle
than cookies.
An alternative would be to use HTTP auth, and use that to retrieve
session information.
:)
---------------------------------------------------------------------
| Name: Tim Nelson | Because the Creator is, |
| E-mail: [EMAIL PROTECTED] | I am |
---------------------------------------------------------------------
----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users