NetTalk Central

Author Topic: Delete some session values from session queue  (Read 3945 times)

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Delete some session values from session queue
« on: April 18, 2012, 12:54:57 AM »
Hallo,

I have a project where a user login and work for many companies on the same session. User will just change the company on the fly in the session. I have around 100 session values in queue. My questions is how can I delete all this values from session queue when user change the company? Can I get a list with all my session values? Is there a way to loop and delete them?
A lot of work to clear by hand ... Also very hard to find them in all procedures.... :o))

Thank you for any help/suggestions,
Regards,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Delete some session values from session queue
« Reply #1 on: April 18, 2012, 01:08:39 AM »
Hi Robert,

yes, you could just manipulate the session queue directly.
Do you have the NetTalk book? There's a section in there on manipulating the queue.

If not, then just look at the inc file to see the sessionDataQueue definition, and go from there.

Cheers
Bruce


Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Delete some session values from session queue
« Reply #2 on: April 19, 2012, 10:20:06 PM »
Thank you Bruce. Found the inc file and the queue's. But very hard to filter the queue to see only my variables... this queue keep a lot of other info.
Maybe a good way is to rename all my variable to something like this: w:MyVariable, p_web.SSV('w:MyVariable',1) , this way I could filter and see only my variable.

Regards,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Delete some session values from session queue
« Reply #3 on: April 20, 2012, 10:29:03 PM »
perhaps Robert the real question is;
Can you delete _all_ of them when the user changes login?

From NetTalk's point of view, if you are effectivly changing a data set, and the user is "starting again" from the Login page, then you could just do a "DeleteSession" - which wold result in all the session variables being deleted.

cheers
Bruce

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Delete some session values from session queue
« Reply #4 on: April 21, 2012, 11:14:54 PM »
>Can you delete _all_ of them when the user changes login?
No, not all of them. This is the point. I want to delete _only_ my own variables. User changes only the company not login. One user could work for many companies...

>and the user is "starting again" from the Login page
No it's not starting from Login page. He is on the same session, and just change the company. Not different data just filter by ID from the same data base.
My problem is that every company has different number of employes etc. Then when I change the company I need to reset all my session variables because this company has different values...
Loop trough queue and clear _only_ my variables it's a good point, instead of p_web.SSV('MyVariable','') hundred of times...

Regards,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Delete some session values from session queue
« Reply #5 on: April 22, 2012, 08:48:31 PM »
ok, in that case I think your idea of some special prefix is a good one. That way you can just do a loop, and look for all the variables with that prefix.

Cheers
Bruce