NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Koen Tjoa on December 02, 2011, 03:07:29 AM

Title: Using IfExistsSessionValue necessary?
Post by: Koen Tjoa on December 02, 2011, 03:07:29 AM
Hi All,

When checking a SessionValue for a certain condition it can be that the SessionValue isn’t set yet. Does this matter? Or is it necessary to check if a SessionValue exists before doing a p_web.GSV when you are not sure it is already set?

Cheers,
Koen
Title: Re: Using IfExistsSessionValue necessary?
Post by: charl99 on December 02, 2011, 06:23:07 AM
If you check a session value that does not exist you will simply get nothing back, so I would say it does not matter.

It's the same as p_web.gsv('AndISpelledItWrong') which makes you look for a problem that does not really exist  :)

Cheers
Charl

Title: Re: Using IfExistsSessionValue necessary?
Post by: Koen Tjoa on December 02, 2011, 03:22:21 PM
Hi Charl,

Thanks, so no problem.  ;)

Cheers,
Koen
Title: Re: Using IfExistsSessionValue necessary?
Post by: Bruce on December 02, 2011, 08:59:54 PM
correct, no problem.
Title: Re: Using IfExistsSessionValue necessary?
Post by: Koen Tjoa on December 05, 2011, 04:28:31 PM
Well unfortunate it was a problem. I was doing this also in the p_web.Translate method and when the SessionVariable doesn’t exist, I got a problem with setting <!—Net:s:MySessionVariable -->, it wasn't set.

No clue why this happened  ???
But first checking if the SessionVariable exists and only then get the SessionVariable solved it.