1

I have a problem with the CAS authentication library in CI3. In CI2.x worked perfectly but with the CI3, the session has been re-designed and it seems to have problems with this library.

This is the error I get:

A PHP Error was encountered

Severity: Runtime Notice

Message: session_start() [function.session-start]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead

Filename: CAS/Client.php



A PHP Error was encountered

Severity: Error

Message: session_start() [function.session-start]: Failed to initialize storage module: user (path: C:\Windows\Temp)

Filename: CAS/Client.php

Here is my config.php settings:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

Note that I'm using a table called 'ci_sessions' in my database to store the session as stated in the CI3 user manual. It works perfectly but once I load the CAS library I get the previous error in the session_start() line.

CAS library extra info https://github.com/eliasdorneles/code-igniter-cas-library Someone wrote a code for easily integrate phpCAS into Codeigniter 2.X but it is no longer mantained nor updated to CI3.

For me, it is mandatory to use the CAS authentication method, any ideas on how to fix this error or use another alternative CAS client?

Thank you very much.

Mitteg
  • 169
  • 1
  • 5
  • 15
  • Are those `[color=#ff3366]` things really in your config? – ksimka Jan 29 '16 at 12:36
  • Possible duplicate of [CAS Authentication Library for CodeIgniter](http://stackoverflow.com/questions/5694970/cas-authentication-library-for-codeigniter) – Abdulla Nilam Jan 29 '16 at 14:36
  • Sorry for the color tags, of course it is a forum issue, i do not have them in my code. And the other thread suggestion, it has no solution because it refers to the CI2.x. Thanks anyway. – Mitteg Jan 29 '16 at 14:41

2 Answers2

0

This is only indirectly connected to the session functions. Update your php.ini with a timezone:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Berlin
Jan
  • 42,290
  • 8
  • 54
  • 79
0

After Fixing your timezone as @Jan suggested,

I believe this may solve your problem , You see by default your output_buffering is Off And you are trying to start session before CAS authentication

session_start() 

Now By turning output_buffering ON , as in

ob_start()
session_start();

you enable buffering and therefore delay sending HTTP headers which maybe can make CAS Work.

These OBs are stackable, so Don't forget to

ob_end_flush()

When you are done using them.

Give it a shot!

Fahad
  • 1,943
  • 22
  • 27