PDA

View Full Version : Session variables?


skinneejoe
03-02-07, 06:59 PM
Hi is there any way to set a session variable using miva script? If so how would I set it and how would I read it?

If there isn't a way to do this, is there a good work around?

Vic - WolfPaw Computers
03-02-07, 07:07 PM
Perhaps if you explained in detail what it is you are trying to do or accomplish, it would be easier to point you in the right direction.

skinneejoe
03-02-07, 07:19 PM
No prob. Say if I was coding with coldfusion, php or asp I could set a session var that would last a specified amount of time (20min, 1hr, etc). That way I could assign a variable something like 'sort=price asc' and I wouldn't have to pass that variable through every url for another page to get ahold of it. I could just reference that variable on any page that needed it. It's like all the system variables that MIVA has available to users, only imagine being able to add a system variable that you could change the value of from any page and then reference it again on another page.

I guess I could use cookies, which is a similar concept, but it's really not the best way to do things because users can clear cookie variables.

skinneejoe
03-02-07, 11:01 PM
Any Ideas?

sebenza
03-02-07, 11:50 PM
MivaScript does not have session variables... like php for example.

RayYates
03-07-07, 12:07 AM
Merchant keeps a table basklupd.dbf that tracks each session_id with a timestamp of the last update. It gets "re-stamped" every time a screen is loaded. That's how it know what sessions to delete from the basket after a period of inactivity.

Implimenting your own tracking table using the session id can be done but requires custom programming.