当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::getId方法代码示例

本文整理汇总了PHP中Session::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::getId方法的具体用法?PHP Session::getId怎么用?PHP Session::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Session的用法示例。


在下文中一共展示了Session::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testRegenerateId

 /**
  * Test session id regeneration.
  * @return void
  */
 public function testRegenerateId()
 {
     $this->session->start();
     $oldId = $this->session->getId();
     $this->session->regenerateId();
     $newId = $this->session->getId();
     $this->assertNotEquals($newId, $oldId);
 }
开发者ID:vrana,项目名称:nette,代码行数:12,代码来源:NetteWebSessionTest.php

示例2: reGenerateSession

 public function reGenerateSession()
 {
     $newSession = new Session();
     $newSession->setIpAddress($this->getIpAddress());
     $newSession->setStatus($this->getStatus());
     $newSession->setUser($this->getUser());
     $newSession->setShippingClass($this->getShippingClass());
     $newSession->setPaymentClass($this->getPaymentClass());
     $newSession->save();
     $_SESSION["ECommSessionId"] = $newSession->getId();
     return $newSession->getId();
 }
开发者ID:anas,项目名称:feedstore,代码行数:12,代码来源:Session.php

示例3: getIndex

 public function getIndex($option = null)
 {
     Session::put('curr_page', URL::full());
     $view = View::make('home');
     $view['sid'] = Session::getId();
     return $view;
 }
开发者ID:kierkegaard13,项目名称:graph-generator,代码行数:7,代码来源:home.php

示例4: __construct

 public function __construct()
 {
     self::$url = 'https://www.google-analytics.com/collect';
     self::$version = '1';
     self::$trackingID = $_ENV['GOOGLE_TRACKING_CODE'];
     self::$clientID = Session::getId();
 }
开发者ID:neraunzaran,项目名称:fruit-dashboard,代码行数:7,代码来源:GoogleTracker.php

示例5: beforeCreate

 public function beforeCreate()
 {
     $this->login_at = new Carbon();
     $this->ip = \Request::getClientIp();
     $this->session_id = \Session::getId();
     return true;
 }
开发者ID:srit83,项目名称:extsentry,代码行数:7,代码来源:Login.php

示例6: getCurrentMember

 /**
  * Returns the current member based on the session id
  * @return Member
  */
 private function getCurrentMember()
 {
     if (!$this->currentMember && !($this->currentMember = Member::currentMember()->first())) {
         $this->currentMember = Member::create(['session_id' => \Session::getId()]);
     }
     return $this->currentMember;
 }
开发者ID:Sparclex,项目名称:studie,代码行数:11,代码来源:SurveyController.php

示例7: recordLogout

 public function recordLogout()
 {
     if ($oLogin = Login::lastLoginWithIpAndSession(\Request::getClientIp(), \Session::getId())->first()) {
         $oLogin->logout();
     }
     return true;
 }
开发者ID:srit83,项目名称:extsentry,代码行数:7,代码来源:User.php

示例8: repoDecodeWeb

 public static function repoDecodeWeb($repo)
 {
     $ret = \Dcrypt\Aes::decrypt(base32_decode($repo), self::key . \Session::getId() . self::githubId());
     if ($ret === false) {
         \App::abort(500);
     }
     return $ret;
 }
开发者ID:apigen-ci,项目名称:apigen-ci,代码行数:8,代码来源:Model.php

示例9: outputCredential

 /**
  * Called by web server<br>
  * 生成并返回凭证。生成的凭证默认存储在Session里。<br>
  * 你可以改写该函数,存储在数据库、文件里、Memcache里都行。凭证数据结构也可以改。
  * @return array
  */
 public function outputCredential()
 {
     $token = str_random(40);
     $sessionId = \Session::getId();
     $credential = array(\Crypt::encrypt($sessionId), \Crypt::encrypt($token));
     \Session::put($this->tokenKey, $token);
     return $credential;
 }
开发者ID:Hehe-Zhc,项目名称:workerboy,代码行数:14,代码来源:CredentialProcessor.php

示例10: getValidFileValidatorFunction

 public static function getValidFileValidatorFunction()
 {
     return function ($attribute, $value, $parameters) {
         $value = intval($value, 10);
         $file = File::find($value);
         return !is_null($file) && ($file->in_use || !is_null($file->session_id) && $file->session_id === Session::getId());
     };
 }
开发者ID:joshhodgson,项目名称:Website,代码行数:8,代码来源:FormHelpers.php

示例11: sessionRemove

 /**
  * To Trigger BEFORE Auth logout
  * 
  * Send Laravel's Session Id and User Id to server
  * via ZMQ before client's websocket connection
  * 
  * @return [type] [description]
  */
 public function sessionRemove()
 {
     $arr = ['session_id' => \Session::getId()];
     if (\Auth::check()) {
         $arr = ['session_id' => \Session::getId(), 'remove_id' => \Auth::id()];
     }
     \Larapush::sync($arr);
 }
开发者ID:redbaron76,项目名称:larapush,代码行数:16,代码来源:LarapushFilter.php

示例12: testSetAndGetAndRegenerateId

 /**
  * @runInSeparateProcess
  */
 public function testSetAndGetAndRegenerateId()
 {
     Session::start();
     Session::setId('1ab2c3d4e5f6g7h8i9');
     $this->assertEquals('1ab2c3d4e5f6g7h8i9', Session::getId());
     Session::regenerateId();
     $this->assertNotEquals('1ab2c3d4e5f6g7h8i9', Session::getId());
 }
开发者ID:titaniumphp,项目名称:sessionmanager,代码行数:11,代码来源:SessionTest.php

示例13: postNew

 public function postNew()
 {
     $question = new Question();
     $question->title = Input::get('title');
     $question->question = Input::get('question');
     $question->answer = Input::get('answer');
     $question->last_session = Session::getId();
     $question->create_by = 1;
     //Sentry::getUser()->id;
     $question->view_count = 0;
     $question->is_visible = Input::get('is_visible', '1');
     $question->pin = Input::get('pin', '0');
     $question->save();
     return Redirect::to('faq');
 }
开发者ID:gitda,项目名称:inventory2,代码行数:15,代码来源:FaqController.php

示例14: postRegister

 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postRegister(Request $request)
 {
     $validator = $this->validator($request->all());
     if ($validator->fails()) {
         $this->throwValidationException($request, $validator);
     }
     $user = $this->create($request->all());
     $previous_session = $user->session_id;
     if ($previous_session) {
         \Session::getHandler()->destroy($previous_session);
         Auth::setUser($user);
         Auth::logout();
     }
     Auth::login($user, $request->has('remember'));
     $user->session_id = \Session::getId();
     $user->save();
     return redirect($this->redirectPath());
 }
开发者ID:jzengg,项目名称:LaravelApp,代码行数:24,代码来源:RegistersUsers.php

示例15: handleUserWasAuthenticated

 /**
  * Send the response after the user was authenticated.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  bool  $throttles
  * @return \Illuminate\Http\Response
  */
 protected function handleUserWasAuthenticated(Request $request, $throttles)
 {
     if ($throttles) {
         $this->clearLoginAttempts($request);
     }
     // if (method_exists($this, 'authenticated')) {
     //     return $this->authenticated($request, Auth::user());
     // }
     $user = Auth::getLastAttempted();
     $previous_session = $user->session_id;
     if ($previous_session) {
         \Session::getHandler()->destroy($previous_session);
         Auth::setUser($user);
         Auth::logout();
     }
     Auth::login($user, $request->has('remember'));
     $user->session_id = \Session::getId();
     $user->save();
     return redirect()->intended($this->redirectPath());
 }
开发者ID:jzengg,项目名称:LaravelApp,代码行数:27,代码来源:AuthenticatesUsers.php


注:本文中的Session::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。