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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   2208 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?