NetTalk Central

Author Topic: Using IfExistsSessionValue necessary?  (Read 3074 times)

Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Using IfExistsSessionValue necessary?
« 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

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Using IfExistsSessionValue necessary?
« Reply #1 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


Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: Using IfExistsSessionValue necessary?
« Reply #2 on: December 02, 2011, 03:22:21 PM »
Hi Charl,

Thanks, so no problem.  ;)

Cheers,
Koen

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Using IfExistsSessionValue necessary?
« Reply #3 on: December 02, 2011, 08:59:54 PM »
correct, no problem.

Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: Using IfExistsSessionValue necessary?
« Reply #4 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.