100+ results for 'php setcookie'

Not the results you expected?

Login.php (https://github.com/bng5/CMS.git) PHP · 159 lines

1 <?php

2

3 class Legacy_Login {

25 $mysqli->query("UPDATE usuarios SET `pase` = NULL WHERE usuario = '{$_SESSION['usuario']}'");

26 session_unset();

27 setcookie("pase", "", 0, '/');

28 setcookie("sesion", "", 0, '/');

35 return;

36 //$this->cerrar_sesion();

37 //header("Location: ".substr($_SERVER['PHP_SELF'], 0, -4));

38 //exit;

39 }

81 $mysqli->query("UPDATE usuarios SET `pase` = '{$pase}' WHERE id = {$fila['id']}");

82 $expira = $_POST['recordarme'] ? time() + 2592000 : 0; //60*60*24*30

83 setcookie("usuario", $fila['usuario'], $expira, "/"); //, ".".DOMINIO);

84 setcookie("pase", $pase, $expira, "/", false, false, true); //, ".".DOMINIO);

em-notices.php (https://gitlab.com/pankajmohale/chef2go) PHP · 251 lines

1 <?php

2 /**

3 *

23 if( is_array($notices) ){

24 $this->notices = $notices;

25 setcookie('em_notices', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true); //unset the cookie

26 }

27 }

44 if( $this->set_cookies ){

45 if(count($this->notices['errors']) > 0 || count($this->notices['alerts']) > 0 || count($this->notices['infos']) > 0 || count($this->notices['confirms']) > 0){

46 setcookie('em_notices', base64_encode(json_encode($this->notices)), time() + 30, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true); //sets cookie for 30 seconds, which may be too much

47 }

48 }

SetCookie.php (https://github.com/noose/zf2.git) PHP · 399 lines

69 /* @var $setCookieProcessor Closure */

70 static $setCookieProcessor = null;

71

72 if ($setCookieProcessor === null) {

73 $setCookieClass = get_called_class();

74 $setCookieProcessor = function($headerLine) use ($setCookieClass) {

75 $header = new $setCookieClass;

109

110 if (count($multipleHeaders) <= 1) {

111 return $setCookieProcessor(array_pop($multipleHeaders));

112 } else {

113 $headers = array();

388 if (!$header instanceof SetCookie) {

389 throw new Exception\RuntimeException(

390 'The SetCookie multiple header implementation can only accept an array of SetCookie headers'

391 );

392 }

HttpTestCaseTest.php (https://github.com/jupeter/zf1.git) PHP · 316 lines

1 <?php

2 /**

3 * Zend Framework

22

23 // Call Zend_Controller_Request_HttpTestCaseTest::main() if this source file is executed directly.

24 if (!defined("PHPUnit_MAIN_METHOD")) {

25 define("PHPUnit_MAIN_METHOD", "Zend_Controller_Request_HttpTestCaseTest::main");

27

28 /** Zend_Controller_Request_HttpTestCase */

29 require_once 'Zend/Controller/Request/HttpTestCase.php';

30

31 /**

40 * @group Zend_Controller_Request

41 */

42 class Zend_Controller_Request_HttpTestCaseTest extends PHPUnit_Framework_TestCase

43 {

44 /**

HandshakeRequest.cs (https://gitlab.com/kbc14a06/BenchmarkProject) C# · 179 lines

140 #region Public Methods

141

142 public void SetCookies (CookieCollection cookies)

143 {

144 if (cookies == null || cookies.Count == 0)

editChildProfileSubmit.php (https://github.com/KevinJones/Emotional-Trainer.git) PHP · 210 lines

1 <?php

2 /*

3

6 Moinak Bandyopadhyay, Jessica Blair, Kevin Jones, Mudit Manu Paliwal and Jacob Solomon.

7

8 Filename: editChildProfileSubmit.php

9 Description: This file contains the php code that runs after a caregiver makes changes to a child's profile and clicks submit.

46 $row = mysql_fetch_object($q);

47 $expire=time()+60*60*24*30;

48 setcookie("ChildID", $row -> ChildID, $expire);

49 $childID1 = $_COOKIE["ChildID"];

50 }

73 $row = mysql_fetch_object($q);

74 $expire=time()+60*60*24*30;

75 setcookie("ChildID", $row -> ChildID, $expire);

76 $childID1 = $_COOKIE["ChildID"];

77 }

langue_preferee_secteur_redirection.php (https://bitbucket.org/pombredanne/spip-zone-treemap.git) PHP · 119 lines

1 <?php

2 /*

3 * langue_preferee

53 include_spip('inc/cookie');

54 // On pose un cookie d'un an de duree de vie

55 spip_setcookie('spip_langue_preferee', $langue_preferee, time() + 3660*24*365, chemin_cookie());

56 } elseif(isset($_COOKIE['spip_lang']) && in_array($_COOKIE['spip_lang'], $langues_secteurs)){

57 //Soit un cookie lang est prsent

59 include_spip('inc/cookie');

60 // On pose un cookie d'un an de duree de vie

61 spip_setcookie('spip_langue_preferee', $langue_preferee, time() + 3660*24*365, chemin_cookie());

62 }elseif (isset($_COOKIE['spip_langue_preferee']) && in_array($_COOKIE['spip_langue_preferee'], $langues_secteurs)) {

63 // Soit deja enregistree dans un cookie

Secret.php (https://github.com/Excito/horde3.git) PHP · 196 lines

1 <?php

2 /**

3 * The Secret:: class provides an API for encrypting and decrypting

7 * available.

8 *

9 * $Horde: framework/Secret/Secret.php,v 1.45.10.14 2009/01/06 15:23:34 jan Exp $

10 *

11 * Copyright 1999-2009 The Horde Project (http://www.horde.org/)

69 $ret = false;

70

71 require_once 'Horde/Util.php';

72 if (Util::extensionExists('mcrypt')) {

73 $old_error = error_reporting(0);

94

95 if (!isset($cache[$cacheIdx])) {

96 require_once 'Horde/Cipher.php';

97

98 $cache[$cacheIdx] = &Horde_Cipher::factory('blowfish');

http.php (https://github.com/jacomyma/GEXF-Atlas.git) PHP · 199 lines

1 <?php

2 /**

3 * @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.

83

84 /**

85 * Takes a $cookie and uses PHP's setcookie() function to add cookies to the output stream.

86 *

87 * @param ezcMvcResultCookie $cookie

104 $args[] = $cookie->secure;

105 $args[] = $cookie->httpOnly;

106 call_user_func_array( 'setcookie', $args );

107 }

108

AlfrescoWebService.php (https://bitbucket.org/kudutest1/moodlegit.git) PHP · 111 lines

1 <?php

2

3 /*

53 if ($sessionId != null)

54 {

55 $this->__setCookie("JSESSIONID", $sessionId);

56 }

57 }

cookies_test.php (https://gitlab.com/x33n/platform) PHP · 227 lines

1 <?php

2 // $Id: cookies_test.php 1506 2007-05-07 00:58:03Z lastcraft $

3 require_once(dirname(__FILE__) . '/../autorun.php');

4 require_once(dirname(__FILE__) . '/../cookies.php');

107 function testAddCookie() {

108 $jar = new SimpleCookieJar();

109 $jar->setCookie("a", "A");

110 $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=A'));

111 }

113 function testHostFilter() {

114 $jar = new SimpleCookieJar();

115 $jar->setCookie('a', 'A', 'my-host.com');

116 $jar->setCookie('b', 'B', 'another-host.com');

117 $jar->setCookie('c', 'C');

118 $this->assertEqual(

119 $jar->selectAsPairs(new SimpleUrl('my-host.com')),

Secret.php (https://github.com/wrobel/horde-fw3.git) PHP · 196 lines

1 <?php

2 /**

3 * The Secret:: class provides an API for encrypting and decrypting

7 * available.

8 *

9 * $Horde: framework/Secret/Secret.php,v 1.45.10.14 2009-01-06 15:23:34 jan Exp $

10 *

11 * Copyright 1999-2009 The Horde Project (http://www.horde.org/)

69 $ret = false;

70

71 require_once 'Horde/Util.php';

72 if (Util::extensionExists('mcrypt')) {

73 $old_error = error_reporting(0);

94

95 if (!isset($cache[$cacheIdx])) {

96 require_once 'Horde/Cipher.php';

97

98 $cache[$cacheIdx] = &Horde_Cipher::factory('blowfish');

SetCookie.php (https://gitlab.com/x33n/respond) PHP · 373 lines

1 <?php

2 namespace GuzzleHttp\Cookie;

3

7 * Set-Cookie object

8 */

9 class SetCookie implements ToArrayInterface

10 {

11 /** @var array */

26

27 /**

28 * Create a new SetCookie object from a string

29 *

30 * @param string $cookie Set-Cookie header string

flavorParamsAction.class.php (https://github.com/richhl/kalturaCE.git) PHP · 140 lines

1 <?php

2 /**

3 * @package Core

5 * @deprecated

6 */

7 require_once ( "kalturaSystemAction.class.php" );

8

9 /**

20 if (!is_null($this->getRequestParameter("advanced")))

21 {

22 $this->getResponse()->setCookie('flavor-params-advanced', $this->getRequestParameter("advanced"));

23 $this->advanced = (int)$this->getRequestParameter("advanced");

24 }

BasketController.php (https://gitlab.com/NickZP/virtuozz.pp.ua) PHP · 134 lines

1 <?php

2

3 namespace App\Http\Controllers\Frontend;

104 $orderHistory->save();

105

106 SetCookie("basket","");

107

108 //Отправка письма клиенту

Cookie.php (https://github.com/albertobraschi/NFS.git) PHP · 279 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Core

23 * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

226 }

227

228 setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);

229

230 return $this;

cookies_test.php (https://github.com/kennethjiang/Wolke.git) PHP · 227 lines

1 <?php

2 // $Id: cookies_test.php,v 1.5 2007/05/07 00:58:03 lastcraft Exp $

3 require_once(dirname(__FILE__) . '/../autorun.php');

4 require_once(dirname(__FILE__) . '/../cookies.php');

107 function testAddCookie() {

108 $jar = new SimpleCookieJar();

109 $jar->setCookie("a", "A");

110 $this->assertEqual($jar->selectAsPairs(new SimpleUrl('/')), array('a=A'));

111 }

113 function testHostFilter() {

114 $jar = new SimpleCookieJar();

115 $jar->setCookie('a', 'A', 'my-host.com');

116 $jar->setCookie('b', 'B', 'another-host.com');

117 $jar->setCookie('c', 'C');

118 $this->assertEqual(

119 $jar->selectAsPairs(new SimpleUrl('my-host.com')),

cls_session.php (https://bitbucket.org/huanteng/touyou.git) PHP · 290 lines

1 <?php

2

3 /**

11 * ============================================================================

12 * $Author: liubo $

13 * $Id: cls_session.php 17217 2011-01-19 06:29:08Z liubo $

14 */

15

114 $this->gen_session_id();

115

116 setcookie($this->session_name, $this->session_id . $this->gen_session_key($this->session_id), 0, $this->session_cookie_path, $this->session_cookie_domain, $this->session_cookie_secure);

117 }

118

263 $GLOBALS['_SESSION'] = array();

264

265 setcookie($this->session_name, $this->session_id, 1, $this->session_cookie_path, $this->session_cookie_domain, $this->session_cookie_secure);

266

267 /* ECSHOP 鑷?畾涔夋墽琛岄儴鍒 */

HttpTestCase.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 281 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: HttpTestCase.php 20096 2010-01-06 02:05:09Z bkarwin $

20 */

21

28 * @see Zend_Controller_Request_Http

29 */

30 require_once 'Zend/Controller/Request/Http.php';

31

32 /**

134 * @return Zend_Controller_Request_HttpTestCase

135 */

136 public function setCookie($key, $value)

137 {

138 $_COOKIE[(string) $key] = $value;

amazon_ecs4_cart.php (https://github.com/ttsuruoka/Services_Amazon.git) PHP · 224 lines

1 <?php

2 //

3 // Example of usage for Services_AmazonECS4

13 require_once 'config.php';

14 require_once 'PEAR.php';

15 require_once 'Services/AmazonECS4.php';

26 }

27

28 $php_self = htmlspecialchars($_SERVER['PHP_SELF']);

29

30 $amazon = new Services_AmazonECS4(ACCESS_KEY_ID, ASSOC_ID);

43 setcookie('CartId', $result['CartId'], time() + 60*60*24);

44 setcookie('HMAC', $result['HMAC'], time() + 60*60*24);

45 } else {

46 $result = $amazon->CartAdd($_COOKIE['CartId'], $_COOKIE['HMAC'], $item);

CookieTest.php (https://github.com/brtriver/sukonv.git) PHP · 221 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2010, Union of Rad, Inc. (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

20 */

21 public function skip() {

22 $sapi = PHP_SAPI;

23 $message = 'Cookie tests cannot be run via command-line interface.';

24 $this->skipIf($sapi === 'cli', $message);

40 }

41 $settings = session_get_cookie_params();

42 setcookie(

43 $name, '', time() - 1000, $settings['path'], $settings['domain'],

44 $settings['secure'], $settings['httponly']

util.php (https://github.com/tyoro/tiarraMetro.git) PHP · 199 lines

1 <?php

2

3 //http://h19e.jugem.jp/?eid=33

31 //暗号化された値をCookieに書き込みます。

32 //DOMAIN_FOR_COOKIEはCookieを使用するサイトのドメインです。

33 setcookie($name,base64_encode($encryptValue),$time , $path, $_SERVER['SERVER_NAME']);

34 }

35

62 if (is_file('/tmp/tM_'.md5($path).'.tmp') && isset($_COOKIE[$name])) {

63 unlink( '/tmp/tM_'.md5($path).'.tmp' );

64 setcookie( $name, null, Cookie::$endExpire, $path, $_SERVER['SERVER_NAME'] );

65 }

66 }

87 //暗号化された値をCookieに書き込みます。

88 //DOMAIN_FOR_COOKIEはCookieを使用するサイトのドメインです。

89 setcookie($name,base64_encode($encryptValue),$time , $path, $_SERVER['SERVER_NAME']);

90

91 //暗号化された値を解読するためのキーをCookieに書き込みます。

pluggable-deprecated.php (https://gitlab.com/woxiprogrammers/infinia-wordpress) PHP · 192 lines

1 <?php

2 /**

3 * Deprecated pluggable functions from past WordPress versions. You shouldn't use these

9 * @package WordPress

10 * @subpackage Deprecated

11 * @see pluggable.php

12 */

13

71 endif;

72

73 if ( !function_exists('wp_setcookie') ) :

74 /**

75 * Sets a cookie for a user who just logged in. This function is deprecated.

173 * WordPress AtomPub API implementation.

174 *

175 * Originally stored in wp-app.php, and later wp-includes/class-wp-atom-server.php.

176 * It is kept here in case a plugin directly referred to the class.

177 *

Native.php (https://github.com/mjaschen/core.git) PHP · 221 lines

1 <?php

2 /**

3 *

4 * Session manager for native PHP sessions

5 *

6 * @category Solar

10 * @author Antti Holvikari <anttih@gmail.com>

11 *

12 * @license http://opensource.org/licenses/bsd-license.php BSD

13 *

14 * @version $Id: Native.php 3366 2008-08-26 01:36:49Z pmjones $

23 *

24 * @config dependency handler A Solar_Session_Handler dependency injection. Default

25 * is the string 'php', which means to use the native PHP session save.

26 * handler instead of a dependency injection.

27 *

HttpTestCase.php (https://github.com/Martin1982/IBMessagingWorkshopServer.git) PHP · 276 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: HttpTestCase.php 20096 2010-01-06 02:05:09Z bkarwin $

20 */

21

23 * @see Zend_Controller_Request_Http

24 */

25 // require_once 'Zend/Controller/Request/Http.php';

26

27 /**

129 * @return Zend_Controller_Request_HttpTestCase

130 */

131 public function setCookie($key, $value)

132 {

133 $_COOKIE[(string) $key] = $value;

class.cookie.php (https://github.com/nils-werner/symphony-2.git) PHP · 182 lines

82 /**

83 * Constructor for the Cookie class intialises all class variables with the

84 * given parameters. Most of the parameters map to PHP's setcookie

85 * function. It creates a new Session object via the `$this->__init()`

86 *

87 * @see __init()

88 * @link http://php.net/manual/en/function.setcookie.php

89 * @param string $index

90 * The prefix to used to namespace all Symphony cookies

167 * is empty, the function will destroy the entire `$_SESSION`

168 *

169 * @link http://au2.php.net/manual/en/function.session-destroy.php

170 */

171 public function expire() {

controller.php (https://github.com/FoolCode/FoolFuuka.git) PHP · 161 lines

1 <?php

2

3 namespace Foolz\FoolFuuka\Themes\Fuuka\Controller;

113 if (isset($post['NAMAE'])) {

114 $data['name'] = $post['NAMAE'];

115 $this->response->headers->setCookie(new Cookie($this->getContext(), 'reply_name', $data['name'], 60*60*24*30));

116 }

117 if (isset($post['MERU'])) {

118 $data['email'] = $post['MERU'];

119 $this->response->headers->setCookie(new Cookie($this->getContext(), 'reply_email', $data['email'], 60*60*24*30));

120 }

121 if (isset($post['subject'])) {

HttpTestCase.php (https://github.com/timglabisch/pimcore.git) PHP · 276 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: HttpTestCase.php 24593 2012-01-05 20:35:02Z matthew $

20 */

21

23 * @see Zend_Controller_Request_Http

24 */

25 // require_once 'Zend/Controller/Request/Http.php';

26

27 /**

129 * @return Zend_Controller_Request_HttpTestCase

130 */

131 public function setCookie($key, $value)

132 {

133 $_COOKIE[(string) $key] = $value;

ResponseHeaderBag.php (https://github.com/xbojer/gfw.git) PHP · 241 lines

1 <?php

2

3 /*

126 * @api

127 */

128 public function setCookie(Cookie $cookie)

129 {

130 $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;

205 public function clearCookie($name, $path = '/', $domain = null)

206 {

207 $this->setCookie(new Cookie($name, null, 1, $path, $domain));

208 }

209

ResponseHeaderBag.php (https://gitlab.com/jjpa2018/dashboard) PHP · 291 lines

1 <?php

2

3 /*

118 }

119 foreach ((array) $values as $cookie) {

120 $this->setCookie(Cookie::fromString($cookie));

121 }

122 $this->headerNames[$uniqueKey] = $key;

178 }

179

180 public function setCookie(Cookie $cookie)

181 {

182 $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;

242 public function clearCookie(string $name, ?string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, string $sameSite = null)

243 {

244 $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite));

245 }

246

detectmobile.class.php (https://github.com/jgulledge19/modMobile.git) PHP · 128 lines

1 <?php

2

3 /**

98

99 if ($mobile_browser) {

100 setcookie($this->get_var,'mobile', time()+60*60*24*30 , '/');

101 return true;

102 }

114 if ( isset($_GET[$this->get_var]) && !empty($_GET[$this->get_var]) ) {

115 if ( $_GET[$this->get_var] == 'mobile' ) {

116 setcookie($this->get_var,'mobile', time()+60*60*24*30 , '/');

117 return 'mobile';

118 } else {

119 setcookie($this->get_var,'full', time()+60*60*24*30 , '/');

120 return 'full';

121 }

StartSession.php (https://github.com/ladybirdweb/agorainvoicing.git) PHP · 291 lines

1 <?php

2

3 namespace Illuminate\Session\Middleware;

107 // If a session driver has been configured, we will need to start the session here

108 // so that the data is ready for an application. Note that the Laravel sessions

109 // do not make use of PHP "native" sessions in any way since they are crappy.

110 $request->setLaravelSession(

111 $this->startSession($request, $session)

213 {

214 if ($this->sessionIsPersistent($config = $this->manager->getSessionConfig())) {

215 $response->headers->setCookie(new Cookie(

216 $session->getName(), $session->getId(), $this->getCookieExpirationDate(),

217 $config['path'], $config['domain'], $config['secure'] ?? false,

session.php (https://github.com/cpucci/oscommerce.git) PHP · 311 lines

1 <?php

2 /*

3 $Id$

108 $class_name = 'osC_Session';

109

110 if ( !osc_empty(basename(STORE_SESSIONS)) && file_exists(dirname(__FILE__) . '/session/' . basename(STORE_SESSIONS) . '.php') ) {

111 include(dirname(__FILE__) . '/session/' . basename(STORE_SESSIONS) . '.php');

137 if ( $sane_session_id === false ) {

138 if ( isset($_COOKIE[$this->_name]) ) {

139 setcookie($this->_name, '', time()-42000, $this->getCookieParameters('path'), $this->getCookieParameters('domain'));

140 }

141

185 if ( $this->_is_started === true ) {

186 if ( isset($_COOKIE[$this->_name]) ) {

187 setcookie($this->_name, '', time()-42000, $this->getCookieParameters('path'), $this->getCookieParameters('domain'));

188 }

189

accmngr.php (https://github.com/nandor/myGreenTown.git) PHP · 188 lines

1 <?php

2 include 'include/lang.php';

3 include 'include/config.php';

4 include 'include/lib.php';

5 include 'include/usr.class.php';

6 include 'include/db.php';

73

74 if (isset ($_COOKIE['userName'])) {

75 setCookie ("userName", $usr->name, time() + 3600000);

76 }

77 echo "ok";

104

105 if (isset ($_COOKIE['userName'])) {

106 setCookie ("userName", $usr->name, time() + 3600000);

107 setCookie ("userPass", $usr->pass, time() + 3600000);

Session.php (https://gitlab.com/igorbabko/mindk) PHP · 207 lines

1 <?php

2 /**

3 * File /framework/session/Session.php contains Session class to easily manipulate

4 * with session variables.

5 *

6 * PHP version 5

7 *

8 * @package Framework\Session

106 if (ini_get("session.use_cookies")) {

107 $params = session_get_cookie_params();

108 setcookie(

109 session_name(),

110 '',

ResponseHeaderBag.php (https://github.com/pmjones/php-framework-benchmarks.git) PHP · 234 lines

1 <?php

2

3 /*

125 * @api

126 */

127 public function setCookie(Cookie $cookie)

128 {

129 $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;

198 public function clearCookie($name, $path = null, $domain = null)

199 {

200 $this->setCookie(new Cookie($name, null, 1, $path, $domain));

201 }

202

user.class.php (https://github.com/Hcamael/CTF_repo.git) PHP · 173 lines

1 <?php

2 class User{

3 var $dbTable = 'users';

50 if ( $remember ){

51 $cookie = base64_encode(serialize(array('email'=>$email,'password'=>$originalPassword)));

52 $a = setcookie($this->remCookieName,

53 $cookie,time()+$this->remTime, $base_path, $this->remCookieDomain, false, true);

54 }

Response.php (https://github.com/tlhunter/sleekmvc.git) PHP · 167 lines

1 <?php

2 namespace Sleek;

3

10 /**

11 * @var array A listing of HTTP status codes

12 * @author http://coreymaynard.com/blog/creating-a-restful-api-with-php/

13 */

14 static public $status = array(

163 }

164

165 return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);

166 }

167 }

TokenBasedRememberMeServices.php (https://github.com/pepellou/symfony.git) PHP · 150 lines

1 <?php

2

3 namespace Symfony\Component\Security\Http\RememberMe;

99 $value = $this->generateCookieValue(get_class($user), $user->getUsername(), $expires, $user->getPassword());

100

101 $response->headers->setCookie(

102 new Cookie(

103 $this->options['name'],

convertFileController.php (https://github.com/matecat/MateCat.git) PHP · 274 lines

1 <?php

2

3 use FilesStorage\AbstractFilesStorage;

108 $conversionHandler->setTargetLang( $this->target_lang );

109 $conversionHandler->setSegmentationRule( $this->segmentation_rule );

110 $conversionHandler->setCookieDir( $this->cookieDir );

111 $conversionHandler->setIntDir( $this->intDir );

112 $conversionHandler->setErrDir( $this->errDir );

ApiAjaxLogin.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 171 lines

1 <?php

2 /**

3 * API module for AjaxLogin extension

44

45 $wgUser->setOption( 'rememberpassword', $Remember ? 1 : 0 );

46 $wgUser->setCookies();

47

48 $result['result'] = 'Success';

Route.php (https://github.com/360i/sonno.git) PHP · 415 lines

1 <?php

2

3 /**

325 * @return \Sonno\Configuration\Route Implements fluent interface.

326 */

327 protected function _setCookieParams(array $cookieParams)

328 {

329 $this->_cookieParams = $cookieParams;

SC_Session.php (https://github.com/nanasess/ec-azure.git) PHP · 144 lines

1 <?php

2 /*

3 * This file is part of EC-CUBE

68 if ($this->cert == CERT_STRING) {

69 $masterData = new SC_DB_MasterData_Ex();

70 $admin_path = preg_replace('/\/+/', '/', $_SERVER['PHP_SELF']);

71 $arrPERMISSION = $masterData->getMasterData("mtb_permission");

72 if (isset($arrPERMISSION[$admin_path])) {

114 /* セッションの破棄 */

115 function EndSession() {

116 // デフォルトは、「PHPSESSID」

117 $sname = session_name();

118 // セッション変数を全て解除する

121 // Note: セッション情報だけでなくセッションを破壊する。

122 if (isset($_COOKIE[$sname])) {

123 setcookie($sname, '', time()-42000, '/');

124 }

125 // 最終的に、セッションを破壊する

LanguageTest.php (https://github.com/UMMS-Biocore/dolphinnext.git) PHP · 181 lines

1 <?php

2

3 declare(strict_types=1);

5 namespace SimpleSAML\Test\Locale;

6

7 use PHPUnit\Framework\TestCase;

8 use SimpleSAML\Configuration;

9 use SimpleSAML\Locale\Language;

168 'language.available' => ['en', 'nn', 'es'],

169 'language.parameter.name' => 'xyz',

170 'language.parameter.setcookie' => false,

171 ], '', 'simplesaml');

172 $_GET['xyz'] = 'Es'; // test also that lang code is transformed to lower caps

CookieManager.php (https://github.com/Yurunsoft/YurunHttp.git) PHP · 317 lines

1 <?php

2 namespace Yurun\Util\YurunHttp\Cookie;

3

34 public function __construct($cookieList = [])

35 {

36 $this->setCookieList($cookieList);

37 }

38

43 * @return void

44 */

45 public function setCookieList($cookieList)

46 {

47 $this->autoIncrementId = 1;

71 * @return \Yurun\Util\YurunHttp\Cookie\CookieItem

72 */

73 public function addSetCookie($setCookie)

74 {

75 $item = CookieItem::fromSetCookie($setCookie);

login.inc.php (https://github.com/SniperOJ/Attack-Defense-Challenges.git) PHP · 139 lines

1 <?php

2

3 /**

5 * This is NOT a freeware, use is subject to license terms

6 *

7 * $Id: login.inc.php 34989 2014-09-24 07:22:03Z nemohou $

8 */

9 if (!defined('IN_DISCUZ')) {

22 }

23

24 require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';

25

26 $ac = !empty($_GET['ac']) ? $_GET['ac'] : 'login';

37 }

38 if($showtip) {

39 dsetcookie('qrauth', '', -1);

40 showmessage('wechat:wechat_member_bind_qrauth_lost');

41 }

test_server.h (https://gitlab.com/iranjith4/hhvm) C Header · 149 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |

6 +----------------------------------------------------------------------+

7 | This source file is subject to version 3.01 of the PHP license, |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

12 | obtain it through the world-wide-web, please send a note to |

13 | license@php.net so we can mail you a copy immediately. |

14 +----------------------------------------------------------------------+

15 */

Pecl_HTTP.php (https://github.com/loudertech/kef.git) PHP · 221 lines

1 <?php

2

3 /**

19 * @copyright Copyright (c) 2008-2012 Louder Technology COL. (http://www.loudertechnology.com)

20 * @license New BSD License

21 * @version $Id: Sockets.php 122 2010-02-11 19:09:18Z gutierrezandresfelipe $

22 */

23

25 * Pecl_HTTPTransport

26 *

27 * Cliente para realizar peticiones HTTP usando la extensión de php pecl_http

28 *

29 * @category Kumbia

131 if(isset($_SESSION['KHC'][$this->_host]['time'])){

132 if($_SESSION['KHC'][$this->_host]['time']>($_SERVER['REQUEST_TIME']-900)){

133 $this->_transport->resetCookies();

134 $this->_transport->setCookies($_SESSION['KHC'][$this->_host]['cookie']);

HeadersTest.php (https://github.com/mrbanzai/zf2.git) PHP · 258 lines

1 <?php

2

3 namespace ZendTest\Http;

6 Zend\Http\Header;

7

8 class HeadersTest extends \PHPUnit_Framework_TestCase

9 {

10 public function testHeadersImplementsProperClasses()

227 {

228 $headers = new Headers();

229 $cookie1 = new Header\SetCookie('foo', 'bar');

230 $cookie2 = new Header\SetCookie('bar', 'baz');

244 {

245 $headers = new Headers();

246 $cookie1 = new Header\SetCookie('foo', 'bar');

247 $cookie2 = new Header\SetCookie('bar', 'baz');

UserServiceImpl.java (https://github.com/Tang-Cong/shop.git) Java · 185 lines

145

146 // 添加写cookie的逻辑,cookie的有效期是关闭浏览器就失效。

147 CookieUtils.setCookie(request, response, "TT_TOKEN", token);

148

149 // 返回token

app.php (https://gitlab.com/YakovLachin/MiMaL) PHP · 182 lines

1 <?php

2

3 require_once __DIR__ . '/../vendor/autoload.php';

59 if (!empty($token)) {

60 $cookie = new Cookie("Mimal-Access-Token", $token , $expire, '');

61 $response->headers->setCookie($cookie);

62 }

63 });

frontController.class.php (https://bitbucket.org/Kadet/pipecms.git) PHP · 166 lines

1 <?php

2

3 /*

32 $this->_pluginManager->loadPlugins();

33

34 if(file_exists(view::$templateDir.'/functions.php'))

35 include view::$templateDir.'/functions.php';

98 if(isset($_GET['lang']))

99 {

100 setcookie('lang', $_GET['lang']);

101 language::$langName = $_GET['lang'];

102 }

Session.php (https://github.com/swoole/framework.git) PHP · 198 lines

32

33 /**

34 * 使用PHP内建的SESSION

35 * @var bool

36 */

48 * 使用PHP提供的Session

49 */

50 if (isset($config['use_php_session']) and $config['use_php_session'])

51 {

52 $this->use_php_session = true;

87 $this->session_lifetime = intval($config['session_lifetime']);

88 }

89 $this->use_php_session = false;

90 /**

91 * 注册钩子,请求结束后保存Session

sfCacheSessionStorage.class.php (https://github.com/proyectoalba/alba.git) PHP · 258 lines

1 <?php

2

3 /**

103

104 // only send cookie when id is issued

105 $this->response->setCookie($this->options['session_name'],

106 $this->id.':'.sha1($this->id.':'.$this->options['session_cookie_secret']),

107 $this->options['session_cookie_lifetime'],

213

214 // update session id in signed cookie

215 $this->response->setCookie($this->options['session_name'],

216 $this->id.':'.sha1($this->id.':'.$this->options['session_cookie_secret']),

217 $this->options['session_cookie_lifetime'],

CookieJar.php (https://github.com/zanehy/hyperf.git) PHP · 312 lines

57 $cookieJar = new self();

58 foreach ($cookies as $name => $value) {

59 $cookieJar->setCookie(new SetCookie([

60 'Domain' => $domain,

61 'Name' => $name,

93 *

94 * @param string $name cookie name to search for

95 * @return null|SetCookie cookie that was found or null if not found

96 */

97 public function getCookieByName($name)

158 }

159

160 public function setCookie(SetCookie $cookie)

161 {

162 // If the name string is empty (but not 0), ignore the set-cookie

EncryptCookies.php (https://gitlab.com/jjpa2018/dashboard) PHP · 194 lines

1 <?php

2

3 namespace Illuminate\Cookie\Middleware;

143 }

144

145 $response->headers->setCookie($this->duplicate(

146 $cookie,

147 $this->encrypter->encrypt(

GazelleRequestGenerator.cs (https://github.com/lidarr/Lidarr.git) C# · 135 lines

52 var request =

53 new IndexerRequest(

54 $"{Settings.BaseUrl.Trim().TrimEnd('/')}/ajax.php?action=browse&searchstr={searchParameters}{filter}",

55 HttpAccept.Json);

56

71 };

72

73 indexRequestBuilder.SetCookies(cookies);

74 indexRequestBuilder.Method = HttpMethod.POST;

75 indexRequestBuilder.Resource("ajax.php?action=index");

94

95 requestBuilder.Method = HttpMethod.POST;

96 requestBuilder.Resource("login.php");

97 requestBuilder.PostProcess += r => r.RequestTimeout = TimeSpan.FromSeconds(15);

98

class.PollUser.inc.php (http://flaimo-php.googlecode.com/svn/trunk/) PHP · 154 lines

1 <?php

2 /**

3 * @package Polls

6 * Including the User class

7 */

8 require_once('class.User.inc.php');

9

10 /**

80 function setCommentWritten($id) {

81 $_COOKIE[$this->commentwritten_varname . $id] = time() + 360;

82 setcookie($this->commentwritten_varname . $id, 1, time() + 360);

83 $_SESSION[$this->commentwritten_varname . $id] = $GLOBALS[$this->commentwritten_varname . $id] = (int) time() +360;

84 session_register($this->commentwritten_varname . $id);

117 $remember_choise = ((isset($values) && is_array($values)) ? implode(',', $values) : $values);

118 $_COOKIE[$this->poll_varname . $id] = $remember_choise;

119 setcookie($this->poll_varname . $id, $remember_choise, time()+31536000);

120 $_SESSION[$this->poll_varname . $id] = $GLOBALS[$this->poll_varname . $id] = $remember_choise;

121 session_register($this->poll_varname . $id);

ZF3.php (https://github.com/bupy7/zf-app-blank.git) PHP · 183 lines

1 <?php

2

3 namespace ExCodeception\Connector;

4

5 use Exception;

6 use PHPUnit_Framework_AssertionFailedError;

7 use Symfony\Component\BrowserKit\Client;

8 use Symfony\Component\BrowserKit\Request;

14 use Zend\Stdlib\Parameters;

15 use Zend\Uri\Http as HttpUri;

16 use PHPUnit_Framework_Exception;

17

18 class ZF3 extends Client

51 $this->destroyApp();

52

53 /** @var \Zend\Http\PhpEnvironment\Request $zendRequest */

54 $zendRequest = $this->getApp()->getRequest();

55

AuthManager.php (https://bitbucket.org/helfreire/tccwebservice.git) PHP · 105 lines

1 <?php namespace Illuminate\Auth;

2

3 use Illuminate\Support\Manager;

18 // will need to be set the encryption instance of the guard, which allows

19 // secure, encrypted cookie values to get generated for those cookies.

20 $guard->setCookieJar($this->app['cookie']);

21

22 $guard->setDispatcher($this->app['events']);

FileListHelper.kt (https://bitbucket.org/codetwister/series.git) Kotlin · 83 lines

19 try {

20

21 val flUrl = URL("http://filelist.ro/takelogin.php")

22 val conn = flUrl.openConnection() as HttpURLConnection

23 conn.readTimeout = 10000

51

52 try {

53 val browseUrl = URL(String.format("http://filelist.ro/browse.php?search=%s&cat=0&searchin=0&sort=0", Uri.encode(searchTerm)))

54 val urlConnection = browseUrl.openConnection() as HttpURLConnection

55

77 val cookieManager = CookieManager()

78 CookieHandler.setDefault(cookieManager)

79 cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL)

80 }

81 }

RedirectResponse.php (https://github.com/linuxserver/Heimdall.git) PHP · 236 lines

1 <?php

2

3 namespace Illuminate\Http;

60 {

61 foreach ($cookies as $cookie) {

62 $this->headers->setCookie($cookie);

63 }

64

Cookie.php (https://github.com/robtuley/knotwerk.git) PHP · 153 lines

1 <?php

2 class T_Test_Cage_Cookie extends T_Unit_Case

3 {

17 $this->assertSame(array(),$cookie->uncage());

18 $this->assertSame(1,$cookie->getNumberCookiesSet());

19 $cookie = $cookie->getSetCookieArgArray(0);

20 $this->assertSame($cookie['name'],'key');

21 $this->assertTrue($cookie['expires']<time());

22 }

23

24 function testCookieSetPassesDataToSetCookie()

25 {

26 $cookie = new T_Test_Cage_CookieStub(array());

33 'domain' => '.domain.com',

34 'secure' => true ),

35 $cookie->getSetCookieArgArray(0) );

36 }

37

UmbracoResponse.cs (https://hg01.codeplex.com/umbraco) C# · 525 lines

402 base.RemoveOutputCacheItem(path, providerName);

403 }

404 public override void SetCookie(HttpCookie cookie)

405 {

406 base.SetCookie(cookie);

HttpTestCase.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 276 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: HttpTestCase.php 10020 2009-08-18 14:34:09Z j.fischer@metaways.de $

20 */

21

23 * @see Zend_Controller_Request_Http

24 */

25 require_once 'Zend/Controller/Request/Http.php';

26

27 /**

129 * @return Zend_Controller_Request_HttpTestCase

130 */

131 public function setCookie($key, $value)

132 {

133 $_COOKIE[(string) $key] = $value;

ref.network.html (https://bitbucket.org/stillzhl/manuals.git) HTML · 237 lines

10 <div class="next" style="text-align: right; float: right;"><a href="function.checkdnsrr.html">checkdnsrr</a></div>

11 <div class="up"><a href="book.network.html">Network</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="ref.network" class="reference">

14 <h1 class="title">Network 函数</h1>

228

229 <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="function.checkdnsrr.html">checkdnsrr</a> — Check DNS records corresponding to a given Internet host name or IP address</li><li><a href="function.closelog.html">closelog</a> — Close connection to system logger</li><li><a href="function.define-syslog-variables.html">define_syslog_variables</a> — Initializes all syslog related variables</li><li><a href="function.dns-check-record.html">dns_check_record</a> — 别名 checkdnsrr</li><li><a href="function.dns-get-mx.html">dns_get_mx</a> — 别名 getmxrr</li><li><a href="function.dns-get-record.html">dns_get_record</a> — Fetch DNS Resource Records associated with a hostname</li><li><a href="function.fsockopen.html">fsockopen</a> — Open Internet or Unix domain socket connection</li><li><a href="function.gethostbyaddr.html">gethostbyaddr</a> — Get the Internet host name corresponding to a given IP address</li><li><a href="function.gethostbyname.html">gethostbyname</a> — Get the IPv4 address corresponding to a given Internet host name</li><li><a href="function.gethostbynamel.html">gethostbynamel</a> — Get a list of IPv4 addresses corresponding to a given Internet host

230 name</li><li><a href="function.gethostname.html">gethostname</a> — Gets the host name</li><li><a href="function.getmxrr.html">getmxrr</a> — Get MX records corresponding to a given Internet host name</li><li><a href="function.getprotobyname.html">getprotobyname</a> — Get protocol number associated with protocol name</li><li><a href="function.getprotobynumber.html">getprotobynumber</a> — Get protocol name associated with protocol number</li><li><a href="function.getservbyname.html">getservbyname</a> — Get port number associated with an Internet service and protocol</li><li><a href="function.getservbyport.html">getservbyport</a> — Get Internet service which corresponds to port and protocol</li><li><a href="function.header-register-callback.html">header_register_callback</a> — Call a header function</li><li><a href="function.header-remove.html">header_remove</a> — Remove previously set headers</li><li><a href="function.header.html">header</a> — Send a raw HTTP header</li><li><a href="function.headers-list.html">headers_list</a> — Returns a list of response headers sent (or ready to send)</li><li><a href="function.headers-sent.html">headers_sent</a> — Checks if or where headers have been sent</li><li><a href="function.http-response-code.html">http_response_code</a> — Get or Set the HTTP response code</li><li><a href="function.inet-ntop.html">inet_ntop</a> — Converts a packed internet address to a human readable representation</li><li><a href="function.inet-pton.html">inet_pton</a> — Converts a human readable IP address to its packed in_addr representation</li><li><a href="function.ip2long.html">ip2long</a> — Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address</li><li><a href="function.long2ip.html">long2ip</a> — Converts an (IPv4) Internet network address into a string in Internet standard dotted format</li><li><a href="function.openlog.html">openlog</a> — Open connection to system logger</li><li><a href="function.pfsockopen.html">pfsockopen</a> — Open persistent Internet or Unix domain socket connection</li><li><a href="function.setcookie.html">setcookie</a> — Send a cookie</li><li><a href="function.setrawcookie.html">setrawcookie</a> — Send a cookie without urlencoding the cookie value</li><li><a href="function.socket-get-status.html">socket_get_status</a> — 别名 stream_get_meta_data</li><li><a href="function.socket-set-blocking.html">socket_set_blocking</a> — 别名 stream_set_blocking</li><li><a href="function.socket-set-timeout.html">socket_set_timeout</a> — 别名 stream_set_timeout</li><li><a href="function.syslog.html">syslog</a> — Generate a system log message</li></ul>

231 </div>

232 <hr /><div class="manualnavbar" style="text-align: center;">

234 <div class="next" style="text-align: right; float: right;"><a href="function.checkdnsrr.html">checkdnsrr</a></div>

235 <div class="up"><a href="book.network.html">Network</a></div>

236 <div class="home"><a href="index.html">PHP Manual</a></div>

237 </div></body></html>

238

AdminConfigTest.php (https://bitbucket.org/sergiu-tot-fb/vendors.git) PHP · 143 lines

1 <?php

2 /**

3 * Copyright © Magento, Inc. All rights reserved.

10 namespace Magento\Backend\Test\Unit\Model\Session;

11

12 class AdminConfigTest extends \PHPUnit\Framework\TestCase

13 {

14 /**

15 * @var \Magento\Framework\App\RequestInterface | \PHPUnit_Framework_MockObject_MockObject

16 */

17 private $requestMock;

18

19 /**

20 * @var \Magento\Framework\ValidatorFactory | \PHPUnit_Framework_MockObject_MockObject

21 */

22 private $validatorFactory;

timezone.php (https://gitlab.com/phamngsinh/baitaplon_sinhvien) PHP · 132 lines

1 <?php

2 /**

3 * @Project NUKEVIET 3.0

51 else

52 {

53 setcookie( $global_config['cookie_prefix'] . '_cltn', false, time() - 86400 );

54 }

55 }

71 define( 'NV_CLIENT_TIMEZONE_DST', $matches2[1] != $matches2[2] ? 1 : 0 );

72 $client_timezone_name = base64_encode( NV_CLIENT_TIMEZONE_NAME . '.' . NV_CLIENT_TIMEZONE_OFFSET . '.' . NV_CLIENT_TIMEZONE_DST );

73 setcookie( $global_config['cookie_prefix'] . '_cltn', $client_timezone_name, 0, $matches2[4], '', 0 );

74 unset( $client_timezone_name, $sd );

75 }

Ecomm360.php (https://github.com/seloshow/Magento-Pruebas.git) PHP · 123 lines

1 <?php

2

3 class Ebizmarts_Mailchimp_Model_Ecomm360 extends Ebizmarts_Mailchimp_Model_MCAPI{

19 $thirty_days = time()+60*60*24*30;

20 if (isset($_REQUEST['mc_cid'])){

21 setcookie('ebiz_mc_pro_campaign_id',trim($_REQUEST['mc_cid']), $thirty_days);

22 }

23 if (isset($_REQUEST['mc_eid'])){

24 setcookie('ebiz_mc_pro_email_id',trim($_REQUEST['mc_eid']), $thirty_days);

25 }

26 }

autoloader.php (https://github.com/ci-blox/Ignition-Go.git) PHP · 87 lines

1 <?php

2

3 $mapping = array(

4 'GuzzleHttp\Client' => __DIR__ . '/GuzzleHttp/Client.php',

5 'GuzzleHttp\ClientInterface' => __DIR__ . '/GuzzleHttp/ClientInterface.php',

6 'GuzzleHttp\Cookie\CookieJar' => __DIR__ . '/GuzzleHttp/Cookie/CookieJar.php',

7 'GuzzleHttp\Cookie\CookieJarInterface' => __DIR__ . '/GuzzleHttp/Cookie/CookieJarInterface.php',

8 'GuzzleHttp\Cookie\FileCookieJar' => __DIR__ . '/GuzzleHttp/Cookie/FileCookieJar.php',

9 'GuzzleHttp\Cookie\SessionCookieJar' => __DIR__ . '/GuzzleHttp/Cookie/SessionCookieJar.php',

10 'GuzzleHttp\Cookie\SetCookie' => __DIR__ . '/GuzzleHttp/Cookie/SetCookie.php',

11 'GuzzleHttp\Exception\BadResponseException' => __DIR__ . '/GuzzleHttp/Exception/BadResponseException.php',

lib_login.php (https://github.com/straup/parallel-flickr.git) PHP · 177 lines

1 <?php

2 #

3 # $Id$

145

146 function login_set_cookie($name, $value, $expire=0, $path='/'){

147 $res = setcookie(

148 $name,

149 $value,

163 $expire = time() - 3600;

164

165 $res = setcookie(

166 $name,

167 $value,

cookie.php (https://gitlab.com/ricardosanchez/prueba) PHP · 89 lines

1 <?php

2 /**

3 * @package Joomla.Platform

78 *

79 * @link http://www.ietf.org/rfc/rfc2109.txt

80 * @see setcookie()

81 * @since 11.1

82 */

83 public function set($name, $value, $expire = 0, $path = '', $domain = '', $secure = false, $httpOnly = false)

84 {

85 setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);

86

87 $this->data[$name] = $value;

HttpTestCase.php (https://github.com/grandison/budo16.git) PHP · 276 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: HttpTestCase.php 18227 2009-09-18 09:30:59Z beberlei $

20 */

21

23 * @see Zend_Controller_Request_Http

24 */

25 // require_once 'Zend/Controller/Request/Http.php';

26

27 /**

129 * @return Zend_Controller_Request_HttpTestCase

130 */

131 public function setCookie($key, $value)

132 {

133 $_COOKIE[(string) $key] = $value;

login.php (https://github.com/pascalvahlberg/icecrewcms.git) PHP · 56 lines

1 <body>

2 <?php

3 include "includes/header.php";

28 $rows = mysql_num_rows($mysql->result);

29 if($rows == 1) {

30 setcookie($cp."_admin_id", $data['id'], time()+60*60*24*$_POST['cookietime'], $path, $domain);

31 setcookie($cp."_admin_name", $data['username'], time()+60*60*24*$_POST['cookietime'], $path, $domain);

32 setcookie($cp."_user_id", $data['id'], time()+60*60*24*$_POST['cookietime'], $path, $domain);

33 setcookie($cp."_user_name", $data['username'], time()+60*60*24*$_POST['cookietime'], $path, $domain);

34 $mysql->query("UPDATE accounts SET remote_addr = '".$_SERVER['REMOTE_ADDR']."' WHERE username = '".$data['username']."'");

35 echo '<meta http-equiv="refresh" content="0; url=admin.php">';

36 }

37 elseif($rows == 0) {

User.php (https://github.com/jfhs/openplayer.git) PHP · 158 lines

1 <?php

2 namespace Manager;

3

111 $key = md5( microtime(true) . $user->id . 'secret' );

112

113 setcookie('sessionKey', $key, time()+(60*60*60*24*14) , '/');

114

115 $q = "UPDATE user SET sessionKey = '{$key}' WHERE id = {$userId}";

122

123 unset($_SESSION[ User::SESS_NS ]);

124 setcookie('sessionKey', null, time() , '/');

125

126 $_SESSION[ User::SESS_NS ][ 'lang' ] = $lang;

MWHttpRequestTestCase.php (https://bitbucket.org/andersus/querytalogo.git) PHP · 245 lines

1 <?php

2

3 use Wikimedia\TestingAccessWrapper;

4

5 class MWHttpRequestTestCase extends PHPUnit_Framework_TestCase {

6 protected static $httpEngine;

7 protected $oldHttpEngine;

18 }

19

20 if ( static::$httpEngine === 'php' ) {

21 $this->assertInstanceOf( PhpHttpRequest::class, $request );

79 }

80

81 public function testSetCookie() {

82 $request = MWHttpRequest::factory( 'http://httpbin.org/cookies' );

83 $request->setCookie( 'foo', 'bar' );

cookie.php (https://github.com/Sipcms/SipCMS.git) PHP · 161 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Cookie helper.

115 $value = Cookie::salt($name, $value).'~'.$value;

116

117 return setcookie($name, $value, $expiration, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);

118 }

119

133

134 // Nullify the cookie and make it expire

135 return setcookie($name, NULL, -86400, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);

136 }

137

SessionServiceProvider.php (https://bitbucket.org/mikebosire/framework.git) PHP · 169 lines

1 <?php namespace Illuminate\Session;

2

3 use Illuminate\Support\ServiceProvider;

144 if ( ! is_null($cookie))

145 {

146 $response->headers->setCookie($cookie);

147 }

148 });

notifications.php (https://github.com/freefis/webim.git) PHP · 67 lines

1 <?php

2 include_once('common.php');

3 include_once S_ROOT.'./uc_client/client.php';

4 $page = max($page, 1);

5 $action = !empty($action) ? $action : (isset($uid) || !empty($pmid) ? 'view' : '');

15 $srchtxtenc = rawurlencode($srchtxt);

16 } else {

17 $multipage = multi($ucdata['count'], $ppp, $page, 'pm.php?filter='.$filter);

18 }

19 $_COOKIE['checkpm'] && setcookie('checkpm', '', -86400 * 365);

22 $today = $timestamp - ($timestamp + $timeoffset * 3600) % 86400;

23 foreach($ucdata['data'] as $pm) {

24 $pm['msgfromurl'] = $pm['fromappid'] && $ucapp[$pm['fromappid']]['viewprourl'] ? sprintf($ucapp[$pm['fromappid']]['viewprourl'], $pm['msgfromid']) : 'space.php?uid='.$pm['msgfromid'];

25 $pm['daterange'] = 5;

26 if($pm['dateline'] >= $today) {

Cookie.php (https://github.com/ladistribution/ladistribution.git) PHP · 152 lines

1 <?php

2

3 /**

4 * La Distribution PHP libraries

5 *

6 * @category Ld

20 protected $_cookieManager = null;

21

22 /* Cookie configuration (see setcookie() for details) */

23

24 protected $_cookieName = 'auth';

44 * Available configuration options are :

45 * cookieName, cookieExpire, cookiePath, cookieDomain, cookieSecure, cookieHttpOnly

46 * (see native setcookie() documentation for more details)

47 *

48 * @param Ld_Cookie $cookieManager the secure cookie manager

SiteController.php (https://gitlab.com/x33n/ImpressPages) PHP · 291 lines

1 <?php

2 namespace Ip\Internal\Admin;

3

39 }

40

41 $content = ipView('view/login.php', array('loginForm' => FormHelper::getLoginForm()));

42 ipAddJs('Ip/Internal/Admin/assets/login.js');

43 $response = ipResponse();

44 $response->setLayout('Ip/Internal/Admin/view/loginLayout.php');

45 $response->setLayoutVariable('content', $content);

46 ipAddJs('assets/languageSelect.js');

59

60

61 $content = ipView('view/passwordReset.php', array('passwordResetForm' => FormHelper::getPasswordResetForm1()));

62 ipAddJs('Ip/Internal/Admin/assets/passwordReset1.js');

63

Curl.php (https://github.com/ggunlugu/ornekler.git) PHP · 318 lines

1 <?php

2 /**

3 * Parent test.

4 */

5 require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Adapter.php';

6

7 /**

162 *

163 */

164 public function testSetCookie()

165 {

166 $this->todo('stub');

172 *

173 */

174 public function testSetCookies()

175 {

176 $this->todo('stub');

class-give-email-access.php (https://bitbucket.org/bryanhui/wordpress-wptouchpoc.git) PHP · 381 lines

1 <?php

2 /**

3 * Email Access

230 // Set cookie.

231 $lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time();

232 @setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );

233

234 return true;

Session.php (git://github.com/phpsec/phpSec.git) PHP · 238 lines

1 <?php namespace phpSec\Common;

2 /**

3 phpSec - A PHP security library

5 @author Audun Larsen <larsen@xqus.com>

6 @copyright Copyright (c) Audun Larsen, 2011

7 @link https://github.com/phpsec/phpSec

8 @license http://opensource.org/licenses/mit-license.php The MIT License

9 @package phpSec

10 */

11

13

14 /**

15 * phpSec core Pimple container.

16 */

17 private $psl = null;

BotPasswordSessionProvider.php (https://github.com/archlinux/archwiki.git) PHP · 193 lines

1 <?php

2 /**

3 * Session provider for bot passwords

38 * - priority: (required) Set the priority

39 * - sessionCookieName: Session cookie name. Default is '_BPsession'.

40 * - sessionCookieOptions: Options to pass to WebResponse::setCookie().

41 */

42 public function __construct( array $params = [] ) {

test_server.h (https://github.com/soitun/hiphop-php.git) C Header · 149 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |

6 +----------------------------------------------------------------------+

7 | This source file is subject to version 3.01 of the PHP license, |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

12 | obtain it through the world-wide-web, please send a note to |

13 | license@php.net so we can mail you a copy immediately. |

14 +----------------------------------------------------------------------+

15 */

Cookie.php (https://github.com/yuan1994/tpAdmin.git) PHP · 211 lines

1 <?php

2 // +----------------------------------------------------------------------

3 // | ThinkPHP [ WE CAN DO IT JUST THINK ]

4 // +----------------------------------------------------------------------

5 // | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.

6 // +----------------------------------------------------------------------

7 // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )

28 'httponly' => '',

29 // 是否使用 setcookie

30 'setcookie' => true,

31 ];

32

94 }

95 $expire = !empty($config['expire']) ? $_SERVER['REQUEST_TIME'] + intval($config['expire']) : 0;

96 if ($config['setcookie']) {

97 setcookie($name, $value, $expire, $config['path'], $config['domain'], $config['secure'], $config['httponly']);

duty.php (https://github.com/pennsong/ShiyishiWeb.git) PHP · 161 lines

1 <?php

2 class duty_Model extends Model{

3 function init(){

82

83 $this->cache->remove($this->key);

84 setcookie('formhash', '', -86400, '/');

85 return $this->duty->save($info);

86 }

weeCookies.class.php (https://github.com/extend/wee.git) PHP · 143 lines

68 @param $offset Offset name.

69 @return bool Whether the offset exists.

70 @see http://www.php.net/~helly/php/ext/spl/interfaceArrayAccess.html

71 */

72

81 @param $offset Offset name.

82 @return mixed Value at given offset

83 @see http://www.php.net/~helly/php/ext/spl/interfaceArrayAccess.html

84 */

85

100 @param $offset Offset name.

101 @param $value New value for this offset.

102 @see http://www.php.net/~helly/php/ext/spl/interfaceArrayAccess.html

103 */

104

class.wp-auth.php (https://github.com/pfond/PFOND.git) PHP · 298 lines

1 <?php

2 class WP_Auth

3 {

269 $secure = isset($_cookie['secure']) ? (bool) $_cookie['secure'] : false;

270

271 // Set httponly if the php version is >= 5.2.0

272 if ( version_compare( phpversion(), '5.2.0', 'ge' ) ) {

273 setcookie( $_cookie['name'], $cookie, $expire, $_cookie['path'], $domain, $secure, true );

274 } else {

275 $domain = ( empty( $domain ) ) ? $domain : $domain . '; HttpOnly';

276 setcookie( $_cookie['name'], $cookie, $expire, $_cookie['path'], $domain, $secure );

277 }

278 }

navBar.php (https://github.com/viglesiasce/testlink.git) PHP · 136 lines

1 <?php

2 /**

3 * TestLink Open Source Project - http://testlink.sourceforge.net/

4 *

5 * Filename $RCSfile: navBar.php,v $

6 *

7 * @version $Revision: 1.53 $

18 *

19 **/

20 require_once('../../config.inc.php');

21 require_once("common.php");

102 $gui->updateMainPage = 1;

103 // set test project ID for the next session

104 setcookie('TL_lastTestProjectForUserID_'. $userID, $args->testproject, TL_COOKIE_KEEPTIME, '/');

105 }

106

Native.php (https://github.com/timdorr/hubugz.git) PHP · 206 lines

1 <?php

2 /**

3 * Colony

25 * @package Bee

26 * @copyright Copyright (c) Army of Bees (www.armyofbees.com)

27 * @license http://www.opensource.org/licenses/mit-license.php MIT License

28 */

29

31 * @see Bee_Session_Abstract

32 */

33 require_once 'Bee/Session/Abstract.php';

34

35 /**

36 * @see Bee_Db_Abstract

37 */

38 require_once 'Bee/Db/Abstract.php';

39

40 /**

cookie.php (https://github.com/dscassel/friendfeedarchiver.git) PHP · 88 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Cookie helper class.

4 *

5 * $Id: cookie.php 1970 2008-02-06 21:54:29Z Shadowhand $

6 *

7 * @package Core

8 * @author Kohana Team

9 * @copyright (c) 2007-2008 Kohana Team

10 * @license http://kohanaphp.com/license.html

11 */

12 class cookie_Core {

21 * @param string URL domain to allow

22 * @param boolean HTTPS only

23 * @param boolean HTTP only (requires PHP 5.2 or higher)

24 * @param string collision-prevention prefix

25 * @return boolean

class-wc-session-handler.php (https://github.com/crowdfavorite/woocommerce.git) PHP · 239 lines

1 <?php

2 if ( ! defined( 'ABSPATH' ) ) {

3 exit;

90

91 // Set the cookie

92 wc_setcookie( $this->_cookie, $cookie_value, $this->_session_expiration, apply_filters( 'wc_session_use_secure_cookie', false ) );

93 }

94 }

113 * Generate a unique customer ID for guests, or return user ID if logged in.

114 *

115 * Uses Portable PHP password hashing framework to generate a unique cryptographically strong ID.

116 *

117 * @return int|string

121 return get_current_user_id();

122 } else {

123 require_once( ABSPATH . 'wp-includes/class-phpass.php');

124 $hasher = new PasswordHash( 8, false );

125 return md5( $hasher->get_random_bytes( 32 ) );

spController.php (http://speedphp.googlecode.com/svn/trunk/) PHP · 260 lines

1 <?php

2 /////////////////////////////////////////////////////////////////

3 // SpeedPHP??PHP??, Copyright (C) 2008 - 2010 SpeedPHP.com //

4 /////////////////////////////////////////////////////////////////

5

151 @ob_start();

152 $domain = ('www.' == substr($_SERVER["HTTP_HOST"],0,4)) ? substr($_SERVER["HTTP_HOST"],4) : $_SERVER["HTTP_HOST"];

153 setcookie($GLOBALS['G_SP']['sp_app_id']."_SpLangCookies", $lang, time()+31536000, '/', $domain ); // ????

154 $_SESSION[$GLOBALS['G_SP']['sp_app_id']."_SpLangSession"] = $lang;

155 return TRUE;

ref.outcontrol.html (https://github.com/cue-taro/emacs-setting-files.git) HTML · 158 lines

10 <div class="next" style="text-align: right; float: right;"><a href="function.flush.html">flush</a></div>

11 <div class="up"><a href="book.outcontrol.html">出力制御</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="ref.outcontrol" class="reference">

14 <h1 class="title">出力制御 関数</h1>

17 <h1 class="title">参考</h1>

18 <p class="para">

19 <span class="function"><a href="function.header.html" class="function">header()</a></span>および<span class="function"><a href="function.setcookie.html" class="function">setcookie()</a></span>

20 も参照ください。

21 </p>

155 <div class="next" style="text-align: right; float: right;"><a href="function.flush.html">flush</a></div>

156 <div class="up"><a href="book.outcontrol.html">出力制御</a></div>

157 <div class="home"><a href="index.html">PHP Manual</a></div>

158 </div></body></html>

159

ResponseAssertionsTest.php (https://github.com/opulencephp/Opulence.git) PHP · 173 lines

1 <?php

2

3 /*

4 * Opulence

5 *

6 * @link https://www.opulencephp.com

7 * @copyright Copyright (C) 2017 David Young

8 * @license https://github.com/opulencephp/Opulence/blob/master/LICENSE.md

9 */

10

11 namespace Opulence\Framework\Tests\Http\Testing\PhpUnit\Assertions;

12

13 use DateTime;

14 use Opulence\Framework\Http\Testing\PhpUnit\Assertions\ResponseAssertions;

15 use Opulence\Http\Responses\Cookie;

16 use Opulence\Http\Responses\JsonResponse;

SessionController.php (https://github.com/cwooijoon/rmitwda-digicel-59432e7abb0f68236a8f955756408c64412accce.git) PHP · 71 lines

1 <?php

2 /**

3 * This is the Session Controller class.

7 session_start();

8

9 require_once(LIBRARY_PATH . DS . 'Template.php');

10 require_once(APP_PATH . DS . 'models/User.php');

25 }

26

27 $this->template->display('add.php');

28 }

29

59 if (ini_get('session.use_cookies')) {

60 $params = session_get_cookie_params();

61 setcookie(session_name(), '', time() - 42000,

62 $params['path'], $params['domain'],

63 $params['secure'], $params['httponly']

cookie.polypage.jquery.js (https://github.com/alvarlaigna/polypage.git) JavaScript · 120 lines

4 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)

5 * Dual licensed under the MIT and GPL licenses:

6 * http://www.opensource.org/licenses/mit-license.php

7 * http://www.gnu.org/licenses/gpl.html

8 *

95 },

96

97 setCookie: function(state,val) {

98 if(!state.length) return false;

99 $.cookie(this.prefixed(state), val ? 'yes' : null, {"path":"/", "expires":this.options.expires});

113 var c = this;

114 this.polypageScope.bind('pp_stateChange', function(e, state) {

115 c.setCookie(state.name, state.value);

116 });

117 }

AuthManager.php (https://gitlab.com/nmhieucoder/laravel_tintuc) PHP · 334 lines

1 <?php

2

3 namespace Illuminate\Auth;

128 // will need to be set the encryption instance of the guard, which allows

129 // secure, encrypted cookie values to get generated for those cookies.

130 if (method_exists($guard, 'setCookieJar')) {

131 $guard->setCookieJar($this->app['cookie']);

test_server.h (https://github.com/kevlund/hiphop-php.git) C Header · 121 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |

6 +----------------------------------------------------------------------+

7 | This source file is subject to version 3.01 of the PHP license, |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

10 | http://www.php.net/license/3_01.txt |

11 | If you did not receive a copy of the PHP license and are unable to |

12 | obtain it through the world-wide-web, please send a note to |

13 | license@php.net so we can mail you a copy immediately. |

14 +----------------------------------------------------------------------+

15 */

ResasBase.php (https://gitlab.com/vchellen_xtn/testaudit) PHP · 143 lines

1 <?php

2 /**

3 * Classe utilise par Page_Resas et Page_Resas_Admin pour assurer l'authentification

131 $this->_resasUser = $resasUser;

132 if ($this->_resasUser) {

133 self::setCookie('ADA001_RESAS_AGENCE', $this->_resasUser->getCookie());

134 if ($this->_adminUser || $this->_resasUser->getConfigData('oav_acces')) {

135 $this->_agence = Agence::factory($this->_resasUser['pdv']);

136 }

137 } else {

138 self::setCookie('ADA001_RESAS_AGENCE', '', time() - 24*3600);

139 }

140 return $this;

VerifyCsrfToken.php (https://github.com/immortalChensm/laravel-work.git) PHP · 180 lines

1 <?php

2

3 namespace Illuminate\Foundation\Http\Middleware;

159 $config = config('session');

160

161 $response->headers->setCookie(

162 new Cookie(

163 'XSRF-TOKEN', $request->session()->token(), $this->availableAt(60 * $config['lifetime']),

CookieJar.php (https://gitlab.com/Georgiy.Zhegusov/museum_documents) PHP · 255 lines

1 <?php

2

3 /*

128 * Updates the cookie jar from a response Set-Cookie headers.

129 *

130 * @param array $setCookies Set-Cookie headers from an HTTP response

131 * @param string $uri The base URL

132 */

133 public function updateFromSetCookie(array $setCookies, $uri = null)

134 {

135 $cookies = array();

136

137 foreach ($setCookies as $cookie) {

138 foreach (explode(',', $cookie) as $i => $part) {

139 if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {

intro.outcontrol.html (https://bitbucket.org/thncr/manuals.git) HTML · 30 lines

10 <div class="next" style="text-align: right; float: right;"><a href="outcontrol.setup.html">安装/配置</a></div>

11 <div class="up"><a href="book.outcontrol.html">输出控制</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="intro.outcontrol" class="preface">

14 <h1 class="title">简介</h1>

16 PHP脚本有输出时,输出控制函数可以用这些来控制输出。这在多种不同情况中非常有用,尤其是用来在脚本开始输出 数据后,发送http头信息到浏览器。输出控制函数不影响由

17 <span class="function"><a href="function.header.html" class="function">header()</a></span> 或 <span class="function"><a href="function.setcookie.html" class="function">setcookie()</a></span>发送的文件头信息,仅影响象

18 <span class="function"><a href="function.echo.html" class="function">echo</a></span>这样的函数和PHP代码块间的数据。

20 <blockquote class="note"><p><strong class="note">Note</strong>:

21 <p class="para">

22 由于早先的版本的缺陷,当从PHP4.1.x(4.2.x,4.3.x)升级时,必须保证<var class="filename">php.ini</var>中的<em>implicit_flush</em> 是 <em>OFF</em>, 否则任何用 <span class="function"><a href="function.ob-start.html" class="function">ob_start()</a></span>的输出将在输出中隐藏掉。

23 </p>

24 </p></blockquote>

27 <div class="next" style="text-align: right; float: right;"><a href="outcontrol.setup.html">安装/配置</a></div>

28 <div class="up"><a href="book.outcontrol.html">输出控制</a></div>

29 <div class="home"><a href="index.html">PHP Manual</a></div>

30 </div></body></html>

31

ExternalAuthenticator.php (https://github.com/fmake/fmake.git) PHP · 152 lines

1 <?php

2 /**

3 * DrupalAuthenticatorImpl.php

33 $prefix = isset($config['ExternalAuthenticator.session_prefix']) ? $config['ExternalAuthenticator.session_prefix'] : "mcmanager_";

34 $useCookie = isset($config['ExternalAuthenticator.use_cookie']) ? $config['ExternalAuthenticator.use_cookie'] == true : true;

35 $dir = basename(dirname($_SERVER["PHP_SELF"]));

36

37 // Always allow language packs to be loaded

93

94 if ($useCookie)

95 setcookie($prefix . 'enabled', md5($secretKey . $_SERVER['REMOTE_ADDR']), 0, '/');

96

97 // Set config parameters

133 $authURL = $prot . "://" . $_SERVER['HTTP_HOST'] . $authURL;

134

135 $returnURL = $prot . "://" . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['PHP_SELF'])) . "/index.php?type=" . $man->getType();

136 $config['authenticator.login_page'] = $authURL . "?return_url=" . urlencode($returnURL);

137 return false;

Facebook.php (https://bitbucket.org/aukhanev/xdn-wordpress31.git) PHP · 135 lines

1 <?php

2

3 /**

86 //// var_dump($_COOKIE);

87 $this->getSession()->set($varName, $signedRequestRaw);

88 // $this->getSession()->setCookie('xdn-fbsr-' . $this->getAppId(), $signedRequestRaw);

89 // var_dump($signedRequestRaw);

90 // echo 'that is... ';

misc.php (https://github.com/hoveychen/Sicily.git) PHP · 83 lines

1 <?php

2

3

11

12 function cleanCookieHash() {

13 setcookie("uid", "", time() - 3600, "/");

14 setcookie("hash", "", time() - 3600, "/");

15 setcookie(session_name(), "", time() - 3600, "/");

16 }

17

61 header("Content-Length: " . filesize($filename));

62 header("Content-Disposition: attachment; filename=\"$localname\"");

63 $fp = fopen("php://output", "w");

64 $outfile = fopen($filename, "r");

65 while (!feof($outfile)) {

main.php (https://gitlab.com/Ltaimao/wecenter) PHP · 78 lines

1 <?php

2 /*

3 +--------------------------------------------------------------------------

59 $this->model('account')->logout();

60

61 $this->model('account')->setcookie_login($user_info['uid'], $_GET['user_name'], $_GET['password'], $user_info['salt'], $expire);

62

63 echo jsonp_encode(AWS_APP::RSM(null, 1, null));

HttpTestCase.php (https://github.com/rdohms/ManoWars.git) PHP · 276 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: HttpTestCase.php 18227 2009-09-18 09:30:59Z beberlei $

20 */

21

23 * @see Zend_Controller_Request_Http

24 */

25 require_once 'Zend/Controller/Request/Http.php';

26

27 /**

129 * @return Zend_Controller_Request_HttpTestCase

130 */

131 public function setCookie($key, $value)

132 {

133 $_COOKIE[(string) $key] = $value;

BaseFacebookAuthenticationProcess.java (https://github.com/ovidiuiliescu/j2mepolish.git) Java · 200 lines

169 String url = getStartUrl();

170 RedirectHttpConnection connection = new RedirectHttpConnection(url);

171 connection.setCookieManager( getCookieManager() );

172 BaseFacebookAuthenticationProcess.this.cookieManager.setCookie(url, connection);

checklogin.php (https://bitbucket.org/nil1511/ipltwister.git) PHP · 64 lines

1 <?php

2 include 'config.php';

25

26 if($count==1){

27 // Register $myusername, $mypassword and redirect to file "login_success.php"

28 $ip = getenv('REMOTE_ADDR');

29 $current_date=gmdate("Y-m-d H:i:s");

49

50 if(isset($_POST['remember'])){

51 setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*COOKIE_TIME_OUT, "/");

52 setcookie("user_key", sha1($ckey), time()+60*60*24*COOKIE_TIME_OUT, "/");

53 setcookie("user_name",$_SESSION['user_name'], time()+60*60*24*COOKIE_TIME_OUT, "/");

54 }

55 header("Location: myaccount.php");

Http.php (https://github.com/boermansjo/wootook.git) PHP · 158 lines

1 <?php

2

3 class Wootook_Core_Controller_Response_Http

127 }

128

129 public function setCookie($name, $value, $lifetime = null, $path = null, $domain = null)

130 {

131 return $this->setRawCookie($name, serialize($value), $lifetime, $path, $domain);

132 }

133

134 public function unsetCookie($name, $path = null, $domain = null)

135 {

136 return $this->setRawCookie($name, null, 0, $path, $domain);

139 public function setRawCookie($name, $value, $lifetime = null, $path = null, $domain = null)

140 {

141 setcookie($name, $value, time() + $lifetime, $path, $domain);

142 return $this;

143 }

registration.php (https://github.com/socialplanning/opencore-wordpress-mu.git) PHP · 184 lines

1 <?php

2

3 function username_exists( $username ) {

158 if ( isset($plaintext_pass) ) {

159 wp_clearcookie();

160 wp_setcookie($userdata['user_login'], $plaintext_pass);

161 }

162 }

post.php (https://github.com/GunioRobot/Loggix.git) PHP · 186 lines

1 <?php

2 /**

3 * Post Comment Controller

13 */

14 $pathToIndex = '../..';

15 require_once $pathToIndex . '/lib/Loggix/Module/Comment.php';

16

17 $app = new Loggix_Module_Comment;

50 if (isset($_POST['user_name'])) {

51 $item['user_cookie']['user_name'] = $_POST['user_name'];

52 setcookie('loggix_comment_user', $item['user_cookie']['user_name'], time()+86400*365, '/');

53 }

54 if (isset($_POST['user_email'])) {

55 $item['user_cookie']['user_email'] = $_POST['user_email'];

56 setcookie('loggix_comment_email', $item['user_cookie']['user_email'], time()+86400*365, '/');

57 }

58 if (isset($_POST['user_uri'])) {

AbstractSessionHandler.php (https://github.com/crmeb/CRMEB.git) PHP · 168 lines

1 <?php

2

3 /*

14 /**

15 * This abstract session handler provides a generic implementation

16 * of the PHP 7.0 SessionUpdateTimestampHandlerInterface,

17 * enabling strict and lazy session handling.

18 *

92 $data = $this->doRead($sessionId);

93 $this->newSessionId = '' === $data ? $sessionId : null;

94 if (\PHP_VERSION_ID < 70000) {

95 $this->prefetchData = $data;

96 }

104 public function write($sessionId, $data)

105 {

106 if (\PHP_VERSION_ID < 70000 && $this->prefetchData) {

107 $readData = $this->prefetchData;

108 $this->prefetchData = null;

SetLoadBalancerHTTPListenerAttributeRequest.php (https://github.com/houdunwang/hdphp.git) PHP · 371 lines

1 <?php

2 /*

3 * Licensed to the Apache Software Foundation (ASF) under one

184 }

185

186 public function setCookieTimeout($cookieTimeout) {

187 $this->cookieTimeout = $cookieTimeout;

188 $this->queryParameters["CookieTimeout"]=$cookieTimeout;

220 }

221

222 public function setCookie($cookie) {

223 $this->cookie = $cookie;

224 $this->queryParameters["Cookie"]=$cookie;

TestSessionListener.php (https://github.com/xbojer/gfw.git) PHP · 77 lines

1 <?php

2

3 /*

72 $params = session_get_cookie_params();

73

74 $event->getResponse()->headers->setCookie(new Cookie(session_name(), session_id(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly']));

75 }

76 }