Understanding Sessions

Events happening in the community are now at Drupal community events on www.drupal.org.
Summitt Dweller's picture

I believe I've violated some unwritten (or more likely just un-read, by me) rule with my pre-production site and now when I attempt to login as the admin I get a WSOD (white screen of death). But, if I refresh the site comes up but with the following warnings:

warning: Cannot modify header information - headers already sent by
(output started at .../htdocs/TTnet/_drupal/sites/all/modules/stc/stc.module:195)
in /homepages/9/d118027584/htdocs/TTnet/_drupal/includes/session.inc on line 97. 

warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in .../htdocs/TTnet/_drupal/includes/session.inc on line 100.

I'm going to take a closeer look at my stc.module code (but earlier I couldn't find anything significant at line 195) and experiment with it a bit. Unless I find something enlightening there I have no idea what's going wrong.

Anybody suggest what this snafu might be?

Comments

Found It, I Think

Summitt Dweller's picture

Went to bed reading the D6 module development book from PACKT (thanks again Michael) that I got at the last IDUG meeting. I figured I was doing something real stupid and the book might straighten me out. Well, I was (probably still am) and I made a quick change...it works!

Problem was, apparently, that I closed my stc.module file with "?>" (creature or habit you know).

Well, the book clearly states in Chapter 2 that you should never close a library script in this manner as you then run the risk of throwing some stray whitespace into your output stream. And if that whitespace occurs before headers are written...trouble. That's apparently just the trouble I was having.

FYI... The line stc.module:195 reported in the header warning was apparently in reference to the end of the script and the ?> mark found on line 194.

So, case closed... for now.

Mark

Mark

Central Iowa Drupal Users Group

Group categories

Category

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: