Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
      My question is, would this be any more secure, or is there a better way of doing this.

There are more ways of doing this than you'd might imagine. Some ways are quite inventive. Let me run a few by you:

  • Persistant Storage: If you have the means of implementing some sort of persistant storage and creating unique ids for given sessions (see CGI::Session) then you can set up something like a database table where you store values and keys. A table might look like:
    create table session_vars ( session_var_id integer not null default nexval ('session_var_id_seq') primary key, session_id varchar(180) not null, session_var varchar(180) not null, -- or whatever size makes sense session_value varchar(180) not null -- again... what makes sense );
    You'd then store the values and retrieve them between pages as appropriate. You'd also need some logic in place in your code that detects that a session has expired and cleans that table out periodically of expired information.
  • Encryption: I've seen more than one scheme used by application programmers where the hidden fields were actually encrypted between pages. Seems like a lot of trouble to go to from where I sit, but it is a valid approach. The encryption key would be stored on the server and something like Blowfish used for encryption/decryption.

There's two approaches, I'm sure other monks can come up with other ways.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

In reply to Re: Secure way of passing variables between forms by blue_cowdawg
in thread Secure way of passing variables between forms by colinb444

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-28 22:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found