Lines Matching refs:PS
66 if (PS(http_session_vars) && PS(http_session_vars)->type == IS_ARRAY) in ZEND_DECLARE_MODULE_GLOBALS()
69 if (PS(session_status) == php_session_active) { \ in ZEND_DECLARE_MODULE_GLOBALS()
77 PS(id) = NULL;
78 PS(session_status) = php_session_none;
79 PS(mod_data) = NULL;
81 PS(http_session_vars) = NULL;
88 if (PS(http_session_vars)) { in php_rshutdown_session_globals()
89 zval_ptr_dtor(&PS(http_session_vars)); in php_rshutdown_session_globals()
90 PS(http_session_vars) = NULL; in php_rshutdown_session_globals()
93 if (PS(mod_data)) { in php_rshutdown_session_globals()
95 PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); in php_rshutdown_session_globals()
98 if (PS(id)) { in php_rshutdown_session_globals()
99 efree(PS(id)); in php_rshutdown_session_globals()
108 if (PS(session_status) != php_session_active) { in php_session_destroy()
113 if (PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) { in php_session_destroy()
130 zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, (void *) &sym_track); in php_add_session_var()
141 …S_ARRAY && Z_ARRVAL_PP(sym_global) == &EG(symbol_table)) || *sym_global == PS(http_session_vars)) { in php_add_session_var()
152 …zend_set_hash_symbol(empty_var, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol… in php_add_session_var()
158 zend_set_hash_symbol(*sym_global, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars))); in php_add_session_var()
165 ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, empty_var, 1, 0); in php_add_session_var()
176 …S_ARRAY && Z_ARRVAL_PP(old_symbol) == &EG(symbol_table)) || *old_symbol == PS(http_session_vars)) { in php_set_session_var()
200 zend_set_hash_symbol(*old_symbol, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars))); in php_set_session_var()
202 …zend_set_hash_symbol(state_val, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol… in php_set_session_var()
205 …zend_set_hash_symbol(state_val, name, namelen, PZVAL_IS_REF(state_val), 1, Z_ARRVAL_P(PS(http_sess… in php_set_session_var()
215 ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, (void **) state_var); in php_get_session_var()
243 if (PS(http_session_vars)) { in php_session_track_init()
244 zval_ptr_dtor(&PS(http_session_vars)); in php_session_track_init()
249 PS(http_session_vars) = session_vars; in php_session_track_init()
252 …ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_… in php_session_track_init()
253 ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 3, 1); in php_session_track_init()
256 ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); in php_session_track_init()
266 if (!PS(serializer)) { in php_session_encode()
269 } else if (PS(serializer)->encode(&ret, newlen TSRMLS_CC) == FAILURE) { in php_session_encode()
281 if (!PS(serializer)) { in php_session_decode()
285 if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) { in php_session_decode()
374 switch (PS(hash_func)) { in php_session_create_id()
387 if (!PS(hash_ops)) { in php_session_create_id()
393 hash_context = emalloc(PS(hash_ops)->context_size); in php_session_create_id()
394 PS(hash_ops)->hash_init(hash_context); in php_session_create_id()
395 PS(hash_ops)->hash_update(hash_context, (unsigned char *) buf, strlen(buf)); in php_session_create_id()
396 digest_len = PS(hash_ops)->digest_size; in php_session_create_id()
406 if (PS(entropy_length) > 0) { in php_session_create_id()
409 size_t toread = PS(entropy_length); in php_session_create_id()
413 switch (PS(hash_func)) { in php_session_create_id()
422 PS(hash_ops)->hash_update(hash_context, rbuf, toread); in php_session_create_id()
430 fd = VCWD_OPEN(PS(entropy_file), O_RDONLY); in php_session_create_id()
434 int to_read = PS(entropy_length); in php_session_create_id()
440 switch (PS(hash_func)) { in php_session_create_id()
449 PS(hash_ops)->hash_update(hash_context, rbuf, n); in php_session_create_id()
461 switch (PS(hash_func)) { in php_session_create_id()
470 PS(hash_ops)->hash_final(digest, hash_context); in php_session_create_id()
476 if (PS(hash_bits_per_character) < 4 in php_session_create_id()
477 || PS(hash_bits_per_character) > 6) { in php_session_create_id()
478 PS(hash_bits_per_character) = 4; in php_session_create_id()
483 outid = emalloc((size_t)((digest_len + 2) * ((8.0f / PS(hash_bits_per_character)) + 0.5))); in php_session_create_id()
484 …j = (int) (bin_to_readable((char *)digest, digest_len, outid, (char)PS(hash_bits_per_character)) -… in php_session_create_id()
501 if (PS(id) && strpbrk(PS(id), "\r\n\t <>'\"\\")) { in php_session_initialize()
502 efree(PS(id)); in php_session_initialize()
503 PS(id) = NULL; in php_session_initialize()
506 if (!PS(mod)) { in php_session_initialize()
512 if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) { in php_session_initialize()
513 …CC, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path)); in php_session_initialize()
518 if (!PS(id)) { in php_session_initialize()
520 PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); in php_session_initialize()
521 if (PS(use_cookies)) { in php_session_initialize()
522 PS(send_cookie) = 1; in php_session_initialize()
532 PS(invalid_session_id) = 0; in php_session_initialize()
533 if (PS(mod)->s_read(&PS(mod_data), PS(id), &val, &vallen TSRMLS_CC) == SUCCESS) { in php_session_initialize()
536 …} else if (PS(invalid_session_id)) { /* address instances where the session read fails due to an i… in php_session_initialize()
537 PS(invalid_session_id) = 0; in php_session_initialize()
538 efree(PS(id)); in php_session_initialize()
539 PS(id) = NULL; in php_session_initialize()
580 if (PS(bug_compat) && !PG(register_globals)) { in php_session_save_current_state()
581 HashTable *ht = Z_ARRVAL_P(PS(http_session_vars)); in php_session_save_current_state()
597 if (do_warn && PS(bug_compat_warn)) { in php_session_save_current_state()
602 if (PS(mod_data)) { in php_session_save_current_state()
608 ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); in php_session_save_current_state()
611 ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); in php_session_save_current_state()
619 PS(mod)->s_name, in php_session_save_current_state()
620 PS(save_path)); in php_session_save_current_state()
624 if (PS(mod_data)) { in php_session_save_current_state()
625 PS(mod)->s_close(&PS(mod_data) TSRMLS_CC); in php_session_save_current_state()
656 PS(mod) = tmp; in PHP_INI_MH()
684 PS(serializer) = tmp; in PHP_INI_MH()
695 PS(use_trans_sid) = (zend_bool) 1; in PHP_INI_MH()
697 PS(use_trans_sid) = (zend_bool) atoi(new_value); in PHP_INI_MH()
745 PS(hash_ops) = NULL; in PHP_INI_MH()
751 PS(hash_func) = val ? 1 : 0; in PHP_INI_MH()
758 PS(hash_func) = PS_HASH_FUNC_MD5; in PHP_INI_MH()
765 PS(hash_func) = PS_HASH_FUNC_SHA1; in PHP_INI_MH()
775 PS(hash_func) = PS_HASH_FUNC_OTHER; in PHP_INI_MH()
776 PS(hash_ops) = ops; in PHP_INI_MH()
886 …if ((Z_TYPE_PP(tmp) == IS_ARRAY && Z_ARRVAL_PP(tmp) == &EG(symbol_table)) || *tmp == PS(http_sessi…
979 …if ((Z_TYPE_PP(tmp) == IS_ARRAY && Z_ARRVAL_PP(tmp) == &EG(symbol_table)) || *tmp == PS(http_sessi…
1135 now = tv.tv_sec + PS(cache_expire) * 60;
1140 …snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=%ld", PS(cache_expire) * 60); /* SAFE …
1151 …eof(buf), "Cache-Control: private, max-age=%ld, pre-check=%ld", PS(cache_expire) * 60, PS(cache_ex…
1189 if (PS(cache_limiter)[0] == '\0') return 0;
1204 if (!strcasecmp(lim->name, PS(cache_limiter))) {
1244 e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL);
1245 e_id = php_url_encode(PS(id), strlen(PS(id)), NULL);
1255 if (PS(cookie_lifetime) > 0) {
1260 t = tv.tv_sec + PS(cookie_lifetime);
1270 if (PS(cookie_path)[0]) {
1272 smart_str_appends(&ncookie, PS(cookie_path));
1275 if (PS(cookie_domain)[0]) {
1277 smart_str_appends(&ncookie, PS(cookie_domain));
1280 if (PS(cookie_secure)) {
1284 if (PS(cookie_httponly)) {
1329 PS(id) = estrndup(Z_STRVAL_PP(ppid), Z_STRLEN_PP(ppid))
1333 int module_number = PS(module_number);
1335 if (PS(use_cookies) && PS(send_cookie)) {
1337 PS(send_cookie) = 0;
1343 if (PS(define_sid)) {
1346 smart_str_appends(&var, PS(session_name));
1348 smart_str_appends(&var, PS(id));
1355 if (PS(apply_trans_sid)) {
1357 …php_url_scanner_add_var(PS(session_name), strlen(PS(session_name)), PS(id), strlen(PS(id)), 1 TSRM…
1370 if (PS(use_only_cookies)) {
1371 PS(apply_trans_sid) = 0;
1373 PS(apply_trans_sid) = PS(use_trans_sid);
1376 switch (PS(session_status)) {
1384 if (!PS(mod) && value) {
1385 PS(mod) = _php_find_ps_module(value TSRMLS_CC);
1386 if (!PS(mod)) {
1392 if (!PS(serializer) && value) {
1393 PS(serializer) = _php_find_ps_serializer(value TSRMLS_CC);
1394 if (!PS(serializer)) {
1399 PS(session_status) = php_session_none;
1404 PS(define_sid) = 1;
1405 PS(send_cookie) = 1;
1408 lensess = strlen(PS(session_name));
1413 if (!PS(id)) {
1414 …if (PS(use_cookies) && zend_hash_find(&EG(symbol_table), "_COOKIE", sizeof("_COOKIE"), (void **) &…
1416 zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
1419 PS(apply_trans_sid) = 0;
1420 PS(send_cookie) = 0;
1421 PS(define_sid) = 0;
1424 if (!PS(use_only_cookies) && !PS(id) &&
1427 zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
1430 PS(send_cookie) = 0;
1433 if (!PS(use_only_cookies) && !PS(id) &&
1436 zend_hash_find(Z_ARRVAL_PP(data), PS(session_name), lensess + 1, (void **) &ppid) == SUCCESS
1439 PS(send_cookie) = 0;
1447 if (!PS(use_only_cookies) && !PS(id) && PG(http_globals)[TRACK_VARS_SERVER] &&
1450 (p = strstr(Z_STRVAL_PP(data), PS(session_name))) &&
1457 PS(id) = estrndup(p, q - p);
1458 PS(send_cookie) = 0;
1465 if (PS(id) &&
1466 PS(extern_referer_chk)[0] != '\0' &&
1471 strstr(Z_STRVAL_PP(data), PS(extern_referer_chk)) == NULL
1473 efree(PS(id));
1474 PS(id) = NULL;
1475 PS(send_cookie) = 1;
1476 if (PS(use_trans_sid) && !PS(use_only_cookies)) {
1477 PS(apply_trans_sid) = 1;
1483 if (!PS(use_cookies) && PS(send_cookie)) {
1484 if (PS(use_trans_sid) && !PS(use_only_cookies)) {
1485 PS(apply_trans_sid) = 1;
1487 PS(send_cookie) = 0;
1492 PS(session_status) = php_session_active;
1496 if (PS(mod_data) && PS(gc_probability) > 0) {
1499 nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg(TSRMLS_C));
1500 if (nrand < PS(gc_probability)) {
1501 PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC);
1514 if (PS(session_status) == php_session_active) {
1515 PS(session_status) = php_session_none;
1523 if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) {
1524 *new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen TSRMLS_CC);
1542 if (!PS(use_cookies) ||
1577 add_assoc_long(return_value, "lifetime", PS(cookie_lifetime));
1578 add_assoc_string(return_value, "path", PS(cookie_path), 1);
1579 add_assoc_string(return_value, "domain", PS(cookie_domain), 1);
1580 add_assoc_bool(return_value, "secure", PS(cookie_secure));
1581 add_assoc_bool(return_value, "httponly", PS(cookie_httponly));
1596 RETVAL_STRING(PS(session_name), 1);
1616 if (PS(mod) && PS(mod)->s_name) {
1617 RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
1629 if (PS(mod_data)) {
1630 PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
1632 PS(mod_data) = NULL;
1647 if (PS(session_status) != php_session_none) {
1672 if (PS(mod_user_names).names[i] != NULL) {
1673 zval_ptr_dtor(&PS(mod_user_names).names[i]);
1676 PS(mod_user_names).names[i] = *args[i];
1695 RETVAL_STRING(PS(save_path), 1);
1719 if (PS(id)) {
1720 RETVAL_STRING(PS(id), 1);
1726 if (PS(id)) {
1727 efree(PS(id));
1729 PS(id) = estrndup(name, name_len);
1744 if (SG(headers_sent) && PS(use_cookies)) {
1749 if (PS(session_status) == php_session_active) {
1750 if (PS(id)) {
1751 if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
1755 efree(PS(id));
1756 PS(id) = NULL;
1759 PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
1761 PS(send_cookie) = 1;
1781 RETVAL_STRING(PS(cache_limiter), 1);
1800 RETVAL_LONG(PS(cache_expire));
1867 if (PS(session_status) == php_session_none) {
1888 if (PS(session_status) != php_session_active) {
1911 if (PS(session_status) == php_session_none) {
1918 SEPARATE_ZVAL_IF_NOT_REF(&PS(http_session_vars));
1919 ht_sess_var = Z_ARRVAL_P(PS(http_session_vars));
1960 if (PS(session_status) == php_session_none || PS(session_status) == php_session_disabled) {
1964 if (PS(session_status) == php_session_disabled) {
1998 SEPARATE_ZVAL_IF_NOT_REF(&PS(http_session_vars));
2018 if (PS(session_status) == php_session_none) {
2023 …if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), p_name, p_name_len+1, (void **)&p_var) == SU…
2133 if (PS(mod) == NULL) {
2138 PS(mod) = _php_find_ps_module(value TSRMLS_CC);
2142 if (PS(serializer) == NULL) {
2147 PS(serializer) = _php_find_ps_serializer(value TSRMLS_CC);
2151 if (PS(mod) == NULL || PS(serializer) == NULL) {
2153 PS(session_status) = php_session_disabled;
2157 if (PS(auto_start)) {
2176 if (PS(mod_user_names).names[i] != NULL) {
2177 zval_ptr_dtor(&PS(mod_user_names).names[i]);
2178 PS(mod_user_names).names[i] = NULL;
2208 …PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as…
2210 PS(session_status) = php_session_none;