• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined variable: _SESSION

When I try to use the $_SESSION var I get:

Undefined variable: _SESSION

Does CI do something with the _SESSION var?

Figured it out.

Turns out you need make sure to start the session:


[eluser]Matthew Lanham[/eluser]
check out:


I'm having the same problem, which is 'Notice: Undefined variable: user_name in c:\Inetpub\wwwroot\nssu2\main_admin.html on line 62'.

This are a few things that i have done to solve my problem, which it will work for you too.

First, on php.ini, you have to activate the ;error_reporting = E_ALL & ~E_NOTICE. Remove ; from error_reporting.

Second, i used echo "<srcipt type=text/javascript>location.href='main_admin.html'</srcipt>"; instead of header("Location: main_admin.html");


$_SESSION['LOGON'] = date("M d Y H:iConfused");

echo "<srcipt type=text/javascript>location.href='main_admin.html'</srcipt>";

ps: please replace srcipt to script. Cause it bcome a problem when i try to post this msg here.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.