Yii Framework Forum: Best place check URL and set cookie - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Best place check URL and set cookie Rate Topic: -----

#1 User is offline   venoel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 01-December 15
  • Location:Ukraine

Posted 25 April 2017 - 04:06 AM

I need: check URL and set cookies if URL contains some GET-parameters.
For example:
if ( isset($_GET['param1']) )
{
    setcookie('param1',$_GET['param1'],strtotime('+1 minutes'));
}


What is the best place in framework to do this?

I have tried use parseUrl method of HttpRequest class, but method is called twice (may be because I have application builded by this way http://www.yiiframew...onend-behavior/)

I can do this in main layout (views/layout/main.php), but it is wrong way I seems.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users