DevHeads.net

Postings by eeadev dev

how to get the expiration date of a cookie

I cannot find a place where is written how to get the expiration date of
the cookie I set.
Please anyone knows how to do that?

thanks

how to simply set a cookie?

I tried with this function

apr_table_add(r->headers_out,"Set-Cookie","doodle=hello");

but I am not seeing the cookie I set when querying my website in chrome dev
tool under application->storage->Cookies

Thanks

how to externally redirect?

how can I redirect externally from my module?

for instance under certain condition I need to go to <a href="http://www.google.com" title="www.google.com">www.google.com</a>

I saw this api
void
<https://ci.apache.org/projects/httpd/trunk/doxygen/group__MOD__ISAPI.html#gacd6cdbf73df3d9eed42fa493d9b621a6>
ap_internal_redirect
<https://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__REQ.html#gac3338d5cb2db319ab2140a48900c87e9>
(const
char *new_uri, request_rec
<https://ci.apache.org/projects/httpd/trunk/doxygen/structrequest__rec.html>
*r
<https://ci.apache.org/projects/httpd/trunk/doxygen/group__MOD__PROXY.html#gac68e921ed15f71060d61

setting getting variable to be changed in production and read in my C module

I have to write a set of variable to be read from my C module. Those
variable could be change when the code is in production, similar to what u
would write in a java properties file.

What is the proper way to do it and which functions to use?

1. write the in the httpd.conf (what is the API for getting/setting a
var visible in all the apache web server)
2. write them in the [module].conf (what is the API for getting/setting
a var visible in all my module)
3.

how to get apr_pool_t when need to call ap_md5

In my function I need to get the checksum using md5.

I saw that there is this function ap_md5(apr_pool_t *a, const unsigned char
*string);

but it needs apr_pool_t

how can I get it?

char key[] = "abc";

key_md5 = ap_md5(mem_pool, key);