close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Trouble with getting a session value to work

Thread begun 1/02/2013 4:53 pm by mrs | Last modified 1/03/2013 12:02 pm by Jason Byrnes | 1437 views | 3 replies |

mrs

Trouble with getting a session value to work

I have tried on numerous occasions to use a session variable via Server Behaviours --> WebAssist --> Cookies --> Set Session Value and applying these settings of Trigger: Recordset is not empty, Session Name: threadID, Value: fld_fID which is the unique ID I am trying to use.

When I place the session variable 'threadID' on my detail page in design view to test it's working, nothing is displayed which implies it is empty. Why is this?

I watched some of your tutorials on building particular parts of websites, and I seem to have applied similar processes when setting a session variable, but I am not getting a value! I can get the value to display if I place the binding from the recordset, but this isn't going to help in what I need. I am trying to take the unique ID of an article on the detail page and allow users to post a response to it via an insert page. It's the insert page page that needs the unique ID of the original article.

I can do this by using a URL variable, but this isn't particularly brilliant because all a user needs to do is change the ID in the address bar and they could be replying to any other record... so I was hoping to use a session variable.

Basically, I am trying to create a very simple forum!

Sign in to reply to this post

mrs

Just to clarify, am I using a session variable in the right way here? Should I be doing this in some other way?

Sign in to reply to this post

mrs

OK, OK, I have just figured it out... I am getting good at this php malarkey... NOT!

Whenever I inserted the session variable, it was inserting at the top of the code just below the require_once file info, but crucially above the recordset that I was trying to collect the info from... so obviously, as the session had been read before the recordset, it was empty.

So, in order to ensure that I am not carrying the incorrect session ID from one record to another once a user has inserted a reply, on the resultant detail page, I have cleared the session variable. Is this the correct procedure?

Am I tackling this in the correct manner? Is a session variable the correct method, and is clearing its value a requirement/good practice?

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, using a session is the best way to accomplish this.

clearing the session after the insert is also a good practice.

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