For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2005 > Saving a hash in a CGI session variable









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Saving a hash in a CGI session variable
epoch

2005-11-27, 6:44 am

Chaps,

During the execution of a CGI script, I query a database and construct a hash. This data will need to be made available to other pages, so rather than query the dbase in every page, I want to save this hash to a CGI session variable.

I researched and found CGI::Session, which I installed with no problem. However, it didn't seem to like saving a hash, so I thought I'd serialize the hash first. I downloaded Data::Serialize, but that doesn't seem to like serializing hashes at all, as the output from serializing my hash is: '^Data::Dumper|||hex|^27323827'. Does anyone have any experience with this problem?

Many thanks,

Si
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com