Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
set default session.cookie_lifetime - to 1 month
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Sharov committed Oct 30, 2012
1 parent 2ddbcc1 commit c5daf80
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@

date_default_timezone_set('Europe/Moscow');

$_SERVER['DOCUMENT_ROOT'] = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT']);
//by default in php.ini session.cookie_lifetime = 0, and it's Session expire - while open browser
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 30);


$_SERVER['DOCUMENT_ROOT'] = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT']);
if (substr($_SERVER['DOCUMENT_ROOT'], -1) != DIRECTORY_SEPARATOR)
{
$_SERVER['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR;
Expand All @@ -17,25 +20,8 @@
require_once LIBRARIES_PATH . 'functions.php';
require_once LIBRARIES_PATH . 'debug.php';


$config = APP_PATH . 'config' . DS . (defined('ENV') ? ENV : CONFIG) .'.php';
//dump($config );

Yii::createWebApplication($config)->run();

//$sections = PageSection::model()->forum()->findAll();
//foreach ($sections as $i => $section)
//{
// for ($k = 0; $k < 5; $k++)
// {
// $page = new Page();
// $page->user_id = 1;
// $page->title = 'Топик ' . $i . $k;
// $page->text = "Текст топика " . $i . $k;
// $page->status = Page::STATUS_PUBLISHED;
// $page->save();
//
// $rel = new PageSectionRel();
// $rel->section_id = $section->id;
// $rel->page_id = $page->id;
// $rel->save();
// }
//}

0 comments on commit c5daf80

Please sign in to comment.