Google
 

Tuesday, February 19, 2008

Sharing Session State between ASP and ASP.NET

Sharing Session State between ASP and ASP.NET

by Sidney Forcier

Despite all of Microsoft's best efforts to make ASP and ASP.NET coexist effortlessly, one area remains a stumbling block... session state. Fortunately the advantages of ASP.NET's upgraded session state management far outweigh the inconvenience of not being able to pass "Classic" session information to .NET. Unfortunately there is no simple solution; the most I can offer is an easy to implement workaround.

In trying to find a suitable resolution, I've come across two good options that are worth mentioning. The first involves parsing the session information out to hidden form fields on a "Classic" intermediate page and then submitting the page to a .NET intermediate page that loads the form fields into the session state. This is a good, simple solution, however it doesn't work both ways. In .NET you cannot specify the page that you submit to. Each page has to PostBack to itself.

The second option is probably closer to an actual solution than to a workaround. Billy Yuen at Microsoft has developed an effective solution. The code is elegant, the integration appears to be seamless, but I couldn't get it to work on my system (remember I said that there was no simple solution, not that there was no solution at all). If this solution works for you, great! You won't need my code and you'll be happily passing session information from "Classic" to .NET like it's going out of vogue, thanks for stopping by.

Ok, if you're still reading let me briefly describe the workaround I've created. It requires a database, but it is not important which type of database (though the code is written for SQL Server). When a page (source page) wants to redirect to another page (destination page) that uses a different version of ASP, it calls an intermediate page. The source intermediate page takes each session variable and adds it to the database along with a Globally Unique ID (GUID). Since "Classic" and .NET use different SessionID formats it is not possible to use SessionID, hence the use of a GUID. The source intermediate page then passes the GUID to the destination intermediate page through a Querystring variable. The destination intermediate page retrieves the session information from the database, cleans up after itself, and then redirects to the destination page. It's similar to the first workaround, but supports transferring state in both directions.

Code Usage

Installation

  1. Run the SQL Query in "ASPSessionState.sql" on the database which will hold the temporary Session information.
  2. Copy the .asp and .aspx.* (SessionTransfer.aspx and SessionTransfer.aspx.cs) files to a folder on your website.
  3. Update connection object information in the "SessionTransfer.asp" and "SessionTransfer.aspx.cs" files. It is located in three places in each file (sorry about not consolidating the connection info).
  4. Compile the aspx files.
  5. The .asp and .aspx.* files must all reside in the same folder to work.

Usage

For use in a Hyperlink (Anchor Tag) or a Response.Redirect, set the destination URL to be one of the following:

From a ASP "Classic" page:

 SessionTransfer.asp?dir=2aspx&url=

From an ASP.NET page:

 SessionTransfer.aspx?dir=2asp&url=

The code will transfer the Session information and Redirect the user to the url specified by or .

Download

You can download the code from here: session_transfer.zip (4.6 KB).

Thursday, January 10, 2008

Are Google Results Hazardous To Your Health?

Pharmaceutical types think so

First thing's first: I'm suspicious of the pharmaceutical industry in general. A lot of people are, but as a journalist, suspicion is part of the job. Also, I have the researcher's tendency toward cyberchondriasis, so take my non-medical expertise for what it's worth.

Which isn't much. I put that out there so others won't have to.

I also make that disclaimer in advance of what is a grander, more important topic: To what extent is the so-called "Googlization of reality" affecting our understanding of the world around us? The answer may not be so available and everybody with a stake in it will give you different answers.

If you took the Internet's word for everything, you might believe that Ron Paul is a Republican frontrunner or that the elephant population has tripled in the past six months (see Stephen Colbert's "wikiality" social experiment).

Clearly, information on the Internet (even Google) isn't perfect, and knowing your source is paramount, hence my opening disclaimer.

The Center for Medicine in the Public Interest (CMPI) is a medical industry thinktank, fronted by former Bush Administration FDA officials. CMPI released a study this week outlining the perils of relying on Google for prescription medication information.

“What we found was not only disturbing, but dangerous to public health,” said CMPI vice president Robert Goldberg. “For millions of Americans, Google has replaced the family physician. People trust, and make decisions, based on the information they find online. With few exceptions, the information we found appeared legitimate but had no medical authority whatsoever. In many cases, we found lawyers posing as medical experts.”

For searches on keywords like "Crestor side effects" and "Avandia side effects" CMPI found:

  • 65% of the first three pages of search results came from sites which were biased or contained unverified information.
  • Almost half of the first three pages of search results belonged to lawyers and attorney referral services seeking plaintiffs for class action lawsuits.
  • Zero official regulatory pages or professional medical organizations appeared in the inventory of results.

Crestor is a cholesterol medication made by AstraZeneca and Avandia is a type 2 diabetes drug produced by GlaxoSmithKline.

Many of the results also referred to "unmoderated" patient forums, sites selling or promoting "alternative medicines" or were sites run by, as CMPI describes them, "anti-pharmaceutical activists."

All of these concerns and findings are published in a 33-page paper entitled "Insta-Americans: The Empowered (and Imperiled) Health Care Consumer in the Age of Internet Medicine." Similar concerns were voiced about selective serotonin reuptake inhibitors and their (Internet) relationship to teen suicide rates and links between vaccinations and autism.

"Much like our email boxes are filled by 'spam' urging us to collect millions from Nigeria or confirm our banking information from phony Ebay or Bank of America security sites, a lot of the medical 'information' on the Web is designed to sell, deceive or frighten, rather than inform," said Goldberg.

Citing a Pew report, CMPI 113 million Americans search for health information, but three quarters rarely check the sources of the information.

According to Peter Pitts, CMPI President and former Associate Commissioner for External Affairs for the FDA, "it is important to remember that not everything online is true. The Internet has made it easier than ever before for charlatans and quacks to spread fear and misinformation. Mark Twain wrote: ―'Beware of health books. You might die of a misprint.' The same can now be said of the Web."

And that can really affect pharmaceutical sales. Because doctors were afraid of lawsuits and patients were afraid of, you know, death, Avandia prescriptions had declined by 60 percent as September 2007.

Of course, it could also have something to do with the black box warning the FDA put on Avandia about increased heart problems. If you use a less targeted keyword, like simply "avandia," you'll find that official government warning (and one for Crestor, too), along with official pharmaceutical company pages, scores of lawyer-sponsored AdWords links, pages from WebMD, the Mayo Clinic, the New York Times, USA Today, and a group called Public Citizen which runs a site called WorstPills.org.

Pitts and Goldberg aren't especially fond of that last group, and single out Dr. Sidney Wolfe, who runs the site, as a source of misinformation about Avandia. Wolfe joins several others with lots of letters behind their names on the site's About page. Maybe it's because Wolfe has a close relationship with Ralph Nader, that CMPI labels them an anti-pharmaceutical activist group. Who knows?

But Wolfe's opinion of Avandia match a Cleveland Clinic doctor named Stephen Nissen, whose May 2007 New England Journal of Medicine article about the drug CMPI cites as a "common source of misinformation." Dr. Nissen's viewpoint however is echoed by a Toronto endocrinologist in this more recent (December 2007) USA Today article.

So why fixate on these drugs in particular? You could present a number of theories. CMPI is partially funded by the pharmaceutical industry, the Lilly Endowment (connected to Eli Lilly) being one of the largest contributors. Patients shying away from pharmaceuticals is bad for business.

A clue could be in reporter Evelyn Pringle's article about Avandia, the FDA and CMPI. Pringle labels CMPI as "a home for industry hit men who served in the Bush Administration's FDA." Pringle explains in detail Pitts' and Goldberg's association with Manning, Selvege & Lee, a PR firm representing many pharmaceutical companies, including AstraZeneca, and with FDA spokesman Douglas Arbesfeld, who has a close relationship with GSK.

But I'm sure that has nothing to do with their opinion on what is misinformation and what isn't.

The extra-cynical of us might also notice CMPI's definite stance against regulation of the health care industry and any type of universal health care. Those cynics might get really crazy and suggest that by advocating a greater reliance on your doctor and the drugs he or she prescribes rather than moonbat alternatives cuts down on the perception that there are flaws in the health care industry in its current privatized state. Plus, with obesity rates the way they are, diabetes medicines are big, big money.

But that's just crazy right?

Well, anyway, CMPI says to check your sources, especially those sources found on Google, the nation's most popular search engine, where most online health research begins. Sometimes people manipulate the information to suit them.

But you might also conclude that a variety of sources is a good thing. I could be wrong. After all, I did all my research for this article on Google.