Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Session in other file


Go to End


2 Posts   1679 Views

Avatar
Edska

Community Member, 1 Post

5 January 2009 at 4:34am

Edited: 05/01/2009 4:36am

Helllo,
I have one problem. I want to add session to file that doesn't belong to silver stripe. For example I have a file called file.php in folder placed near siler stripe folders mysite, sapphire, themes and so on. I want to use - Session::get("variable") in my file.php. I tried to include Session.php, Controller.php, but i can't get my session variable. I get Fatal error: Class 'Session' not found in /xxx/xxx/xxx/xxx/public_html/gui/file.php on line 3

Avatar
Hamish

Community Member, 712 Posts

5 January 2009 at 3:37pm

Your path to Session.php must be incorrect. What does your directory structure look like?