close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Undefined variable: _SESSION

Thread began 6/01/2009 8:00 am by lee266802 | Last modified 6/01/2009 5:29 pm by Ray Borduin | 8503 views | 3 replies |

lee266802

Undefined variable: _SESSION

I have created a log out page where I have applied the "Clear Session Values" SB. The trigger is set to "before page load".

When I go to this page I get the following error message:

Notice: Undefined variable: _SESSION in C:\wamp\www\firth_web_works\logout.php on line 7

Here is the code added by this SB

<?php
if ("" == ""){
// WA_ClearSession
$clearAll = TRUE;
$clearThese = explode(",","");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

You probably need to add:

session_start();

somewhere above that code.

Sign in to reply to this post

lee266802

That fixed it Ray thank you. But why should I have to add any code? The whole idea of these SB's is so that you shouldn't have to code.

Sign in to reply to this post

Ray BorduinWebAssist

Yes. Usually this code is on a page with the shopping cart, which adds the session start automatically. I agree it should be added. I will log it as a bug.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...