close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Session Variables & Forgotten Password

Thread began 1/24/2012 6:33 am by gary.brett434358 | Last modified 1/24/2012 8:39 am by newimage96814918 | 1215 views | 3 replies |

gary.brett434358

Session Variables & Forgotten Password

Hi,
I have created pages using SA wizard, in server behaviour panel on login page I edit both instances of 'Security Assist Authenticate User' to add session values of 'SecurityAssist_ContactID', 'SecurityAssist_UserGroupID' & 'SecurityAssist_Firstname'. I havent created security on any pages yet as still early testing but I have the redirect go index.php?loggedIn=1 on successful login, is this wrong?

In index.php I dragged the 'SecurityAssist_Firstname' session from bindings tab onto page but it returns error of "Notice: Undefined variable: _SESSION in C:\wamp\www\index.php on line 175"

Lind 175 is "<span>Welcome back,<?php echo $_SESSION['SecurityAssist_ContactID']; ?> </span>"

Do I need to set security on all pages to get the session to follow through, I was under impression session stored anyway?

Thanks

Sign in to reply to this post

newimage96814918

Make sure you got: <?php session_start(); ?>
at the top of any page that your calling a session variable or you'll get that error

Tracy

Sign in to reply to this post

gary.brett434358

Originally Said By: newimage96814918
  Make sure you got: <?php session_start(); ?>
at the top of any page that your calling a session variable or you'll get that error

Tracy  



That's great Tracy, many thanks for your help, works a treat.

At present I am having to manually add code to each page that redirects depending on UserGroupID, is that the best way to work this do you know?

I have 4 groups, depending on who logs on they get a different home page I( have added this to a 'blank' home page used only to redirect users to their homepage:

<?php
if(!session_id()) session_start();
switch($_SESSION['SecurityAssist_UserGroupID']) {
case "2":
header("Location: direct_tblcontacts_Results.php");
break;
case "4":
header("Location: staff_tblcontacts_Results.php");
break;
case "5":
header("Location: admin_tblcontacts_Results.php");
break;
}
?>

Do you know if SA does this automatically?

Thanks again

Gary

Sign in to reply to this post

newimage96814918

That's the only way I know how to do it, though there may be a way with datassist I just have'nt figured it out yet.

Note also any pages created by the wizards or update pages, it will add itself. You'll only have to do that for your custom pages that you are calling
session variables from....

Tracy

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