Jump to content

updating sessions via hidden iframes ? Good or Bad?


Recommended Posts

Hello, I'm a js  newbie so all help is appreciated.

Suppose I had a site that sold wallets.

I would want to use some js to dynamically change the wallet type (bifold, trifold, etc) , wallet color, and possibly other variables (im not really selling wallets, just an example).

 

Currently I know how to make a call to the js function to dynamically change things based on user input.

The function also currently "saves" the user variables by writing the variables onto a link that loads into a hidden iframe. The link serves as _GET vars, and I can simply store them as session vars within the referenced page.

 

My question is if this practice is "common" and if its "good practice".

And if anyone knows of a better way to store vars via js, do tell.

 

Thanks

 

Yes, I want to set, update, and show server session vars (php). 

 

Actually I am using some ajax framework found here:  http://www.robertnyman.com/ask/

The problem is , within the ajax calls, I am unable to reference, display, or alter any session data whatsoever.

 

I assumed I would be able to use ajax to run a .php page that simply had "session_start();" in it and gain access that way. But it simply does not display the session data.

 

I am a js newbie, so I may be in over my head here, but after some research, I think it has something to do with "race conditions". something like this: http://www.chipmunkninja.com/g@

and another guy with the same problem http://codeigniter.com/forums/viewthread/76343/

 

So now I just use the iframe to edit and store my session vars, but actually that still does not allow me to display  any session vars within a page being run via an ajax request.

They will only show when I reload a fresh page.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.