By Balth on
Hello,
I 've created a personal page 'custom.php', located at the root of my website (www/drupal/custom.php).
This page is called by a simple link : a href="/cust.php" ....
In this page I try to get session values, but I can't.
print($_SESSION) return me an error.
Notice: Undefined variable: _SESSION in C:\www\druapl\cust.php on line 5
Can someone explain how to get back global $_SESSION ?
Thanks in advance.
Comments
Try to add sesstion_start()
Try to add sesstion_start() to your script. http://php.net/manual/en/function.session-start.php
Hi, I did it but it doesn't
Hi,
I did it but it doesn't work.
This is my whole file cust.php
Aim of my code is just to add a variable 'themekey_theme' to my session and also switch the value of the variable on every call of the page.
However, with session_start(); I got a new empty session, it doesn't give me the current session of the web site.
A strange point is :
It seems that the session started with cust.php is persisted because it always remember the last value of the variable 'themekey_theme' and it switch it on every call.
Note : error appears only when session_start() is commented, otherwise I got
I'm not a php session guru
I'm not a php session guru unfortunately... if session_start does not work, I would try
drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION): http://api.drupal.org/api/function/drupal_bootstrap/6Thank You ! It's exaclty what
Thank You !
It's exaclty what I needed.
Great. thanks for the
Great. thanks for the feedback.