close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Session not created

Thread began 2/04/2010 1:16 am by info97301 | Last modified 2/05/2010 10:49 am by Jason Byrnes | 1352 views | 3 replies |

info97301

Session not created

Hi

I'm tearing my hair out with this! I have used the wizard for creating registration/login/logout/reminder/update profile pages. If I log in it goes to the update profile page properly, and I have added the 'MemID' number to the display, just so I know it's created.

I then created another page, with a recordset based on the MemID Session (I have even tried this by copying the recordset on the update profile page) - but no record is found.

I have created this on numerous pages now, all with the same result - nothing! I've added new records to the database and logged on as them and the correct profile is always displayed, along with the MemID number - but can I get it to work on a different page??? NO!

On a test page, I inserted the MemID session value to display and get the following error:

PHP Notice: Undefined variable: _SESSION in C:\Inetpub\wwwroot\cwtest\admin\users\index.php on line 98

Line 98 is just: <h1>Welcome <?php echo $_SESSION['MemID']; ?></h1>

so the page should read Welcome 1234 (where 1234 is the MemID number).

I'm not unfamiliar with database driven sites - mainly with ASP though - but am fairly new to using the WA stuff, so any help much appreciated, before I go totally bald.

Cheers
Chris

Sign in to reply to this post

Jason ByrnesWebAssist

PHP can "loose sight" of the session collection.

On any page where you wish to use session information, you should include the following code before calling the session variable:

php:
<?php if(!session_id()) session_start(); ?>




this will force PHP to look for the session collection.

I often add that code to my connections file or another include file that is on every page in the site to make sure it is always present without having to think about it.

Sign in to reply to this post

info97301

Hi Jason

Thanks for that tip - I will use it.

I think I have found the xause of the problem - it appears that only pages which have some SA access rule on store the session variable - though this seems a bit bizarre to me! I had created a recordset where MemID = the Session variable and no record was found. However, when I applied the page access rules, it worked! Perhaps one of those little idiosynchracies that I'll have to learn.

Thanks again

CHris

Sign in to reply to this post

Jason ByrnesWebAssist

applying the access rule automatically adds the code:
<?php if(!session_id()) session_start(); ?>


you can manually add that code to your page instead of applying the access rule.

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...