|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
glum Smarty n00b
Joined: 02 May 2011 Posts: 4
|
Posted: Mon May 02, 2011 8:43 pm Post subject: SmartyValidate/SmartyPaginate and sessions |
|
|
Hello,
I have multiple applications on the same server that uses smartyvalidate and smartypaginate. I think when someone uses two or more of these applications in the same browser session, some overwriting of the smartyvalidate and smartypaginate session variables may be occurring. Does anyone know of a way to fix this situation besides putting each app on its own server?
Regards. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon May 02, 2011 9:45 pm Post subject: |
|
|
With SmartyValidate you can use a unique form id for each form, and you can make that coincide with the application. With SmartyPaginate you can use a unique connection id, again use the application to coincide with the id. It's in the docs for both of them. |
|
Back to top |
|
glum Smarty n00b
Joined: 02 May 2011 Posts: 4
|
Posted: Tue May 03, 2011 12:43 am Post subject: |
|
|
Thanks Mohrt! I appreciate the help.
I'll give it a try. |
|
Back to top |
|
glum Smarty n00b
Joined: 02 May 2011 Posts: 4
|
Posted: Wed May 04, 2011 3:56 am Post subject: |
|
|
I notice in 3.02, the docs say this:
"SmartyValidate::disconnect();
SmartyValidate::disconnect(true);
This clears the SmartyValidate session data for the current form. Call
this after you are completely finished with the SmartyValidate form.
(eg. do NOT call between posts to the same form.) A parameter of true
will force all forms to reset."
I am running 2.x, so I can't test the above right now. I apologize for this. Does this mean that 3.02's "SmartyValidate::disconnect() will not wipe out the variables for other registered forms in a session that have unique IDs (say the other forms are open in tabs) like it seems to do in 2.x? If yes, is the workaround in 2.x not to call SmartyValidate::disconnect() at all? Usually, I call disconnect after a successful submit/validation...maybe I shouldn't if the above case is possible? If yes, are there any problems I should be aware of if I don't call disconnect in 2.x at all?
Best Regards. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed May 04, 2011 3:59 am Post subject: |
|
|
disconnect() should remove the current form, not the entire session. It isn't necessary to disconnect for things to work, it is meant to clear data from the session you know you will not be using again. |
|
Back to top |
|
glum Smarty n00b
Joined: 02 May 2011 Posts: 4
|
Posted: Thu May 05, 2011 2:34 am Post subject: |
|
|
Thanks again, mohrt! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|