books
Free Books / Computers / Practical mod_perl /

previous page: A.6. Sending Multiple Cookies with the mod_perl API
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: A.8. CGI::params in the mod_perlish Way

A.7. Sending Cookies in REDIRECT Responses




Description

This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl

You should use err_headers_out( ), not headers_out( ), when you want to send cookies in a REDIRECT response or in any other non-2XX response. The difference between headers_out( ) and err_headers_out( ) is that the latter prints even on error and persists across internal redirects (so the headers printed for ErrorDocument handlers will have them). Example A-3 shows a cookie being sent in a REDIRECT.

Example A-3. redirect_cookie.pl

use Apache::Constants qw(REDIRECT OK);
my $r = shift;
# prepare the cookie in $cookie
$r->err_headers_out->add('Set-Cookie' => $cookie);
$r->headers_out->set(Location => $location);
$r->status(REDIRECT);
$r->send_http_header;
return OK;

 

Continue to:

  • prev: A.6. Sending Multiple Cookies with the mod_perl API
  • Table of Contents
  • next: A.8. CGI::params in the mod_perlish Way

Books by Stas Bekman:















TOP
previous page: A.6. Sending Multiple Cookies with the mod_perl API
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: A.8. CGI::params in the mod_perlish Way

Topics

  • Animals
  • Architecture
  • Arts
  • Business
  • Computers
  • Crafts
  • Fairy Tales
  • Finance
  • Flora and Plants
  • Cooking
  • Gardening
  • Health and Healing
  • History
  • Home Improvements
  • Languages
  • New Age
  • Novels
  • Real Estate
  • Reference
  • Religion
  • Science
  • Society
  • Sports
  • Travel
  • Outdoors


Search

My Books

Headaches Begone! A Systemic Approach To Healing Your Headaches
Don't Let Your Bike Seat Ruin Your Sex Life Book

Discover

  • Answers FAQ

[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007-2021 StasoSphere.com