Plugin Problems
Background:
I am a noob using Vanilla on a local host Win7 machine.
I wrote a simple plugin that uses the DiscussionsController_Render_Before event to intercept an incoming url and either zoom in on a given discussion (add a comment to it) or start a new one within a category (derived from a variable in the URL). The DiscussionsController_Render_Before, based on the URL variables either does nothing or redirects to a new discussion page or to an existing discussion.
Problem:
This worked for a while just fine but, when i wanted to test this plugin starting from scratch (a new database then enable the plugin) every time a redirect was called for, the Login page appeared even though the user was logged in (as indicated on the page where the login form was presesnted).
What would cause Vanilla to surmize that a login page should be displayed when a user is actually logged in?
Much appreciated
Best Answers
-
hbf MVP
for me it's been caused by something invalidating the session or cookie, like crossing between domains or something.
0 -
hbf MVP
Bey said:
Thanks.Just in case there is something common between our cases, how did you resolve / get around your issue?
I don't think domain crossing is relevant in my case as I test my plugin by clicking on urls in a Microsoft Word document.
I am not sure about cookies but I did go through the exercise of deleting cookies and files using the browser Options.
sorry i don't have a real answer for you on this. for me, when i am playing with my site and do something drastic, i have experienced an un-anticipated log-out. but this does not happen under normal, stable circumstances. i've not dug into it for myself since it seems to happen very infrequently, but i recall it happening when i made a change that modified the url of the site.
Hopefully someone else will have more insight for you.
0
Answers
for me it's been caused by something invalidating the session or cookie, like crossing between domains or something.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Thanks.
Just in case there is something common between our cases, how did you resolve / get around your issue?
I don't think domain crossing is relevant in my case as I test my plugin by clicking on urls in a Microsoft Word document.
I am not sure about cookies but I did go through the exercise of deleting cookies and files using the browser Options.
Additional info following some more experimentation...
I was able to get around this issue (on one workstation) by:
Starting with a new database then doing some work on the site (adding categories, entering deleting some discussions, etc.)
Logging out
Logging in through phpadmin by clicking on the appropriate project link.
After this sequence, the Login page did not appear when a user was logged on to the forum site.
I cannot make much sense of it but, hopefully, some php/vanillla maven can.
sorry i don't have a real answer for you on this. for me, when i am playing with my site and do something drastic, i have experienced an un-anticipated log-out. but this does not happen under normal, stable circumstances. i've not dug into it for myself since it seems to happen very infrequently, but i recall it happening when i made a change that modified the url of the site.
Hopefully someone else will have more insight for you.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Check your Garden.Cookie.* settings in your config. Make sure they match reality. Then clear all your own cookies, especially if you changed this setting.
Vanilla Forums COO [GitHub, Twitter, About.me]
Thanks Tim, I will look into it.
But, if I may fish for another tip in this direction because i think it has validity...
Please consider that the setting I am working with is NOT any web site in which Vanilla is embedded.
I am working with a wamp localhost server (listening on port other than 80 as I have IIS on that machine too). Vanilla with my plugin are installed on that machine. All my testing is done using a URL in Microsoft Word document in order to emulate a scenario that is not implemented yet - embedding Vanilla Forums in the application). When all issues are resolved, someone else (a developer) may do the embedding of Vanilla in the application which will have links that will generate and invoke those URLs .
That means (I think) that there should be no cookies interference, but, again, I am NOT a web developer and have only conceptual understanding of what cookies are all about (preserving some state of a web session).
Therefore, I am not sure what to look for in 'matching reality'. Also, I did not chage any configuration settings related to cookies (I did not know enough to be dangerous in this case).
Much appreciated.
I... I dont even...
Vanilla Forums COO [GitHub, Twitter, About.me]
lol - Love your creativity and humor ...
I know it is weird but, I have this project on my calendar to look into Vanilla Forums with a view towards embedding it in our web app. I am not a developer and have no access to the site nor the software. So, i came up with the idea of emulating someone clicking on a link resulting in the application generating then invoking such URL(s). For a long time i did not encounter any issue with this but then ... I did ... as noted above. As far as i could tell, it was similar to clicking on the link below where that link sits in a Word document:
vanillaforums.org/discussion/18559/plugin-problems
Except in my case the link was to my local host.
Should this be an issue?
Why don't you ebbed a browser object in your app or am I misunderstanding?
It is vile but possible to develop with office. some witchcraft called vba.
The app, or object has to has to capacity to handle sessions and cookies.
Note there are client sessions as well as user session. if you start a client with a new session/user it will not link that session to cookies for security reasons.
There are also differences between how clients handle data like cookies.
Also you might check that the server is not restarting itself for whatever reason.
grep is your friend.
I didn't know Canadians watched carry on films.
grep is your friend.
Thanks x00.
I can use vba or even VB if needed but before i embark on another sub project in order to emulate a click on a URL i need to be convinced that this, indeed, is the issue.
Since my plugin used to work fine using the link-in-doc mechanism before, i need to understand what it is that made it stopped working.
I just don't see how issuing a url click from within vba code (or VB project) would make any difference.
The Config Cookies approach seems much more relevant to me but, being a cookie initiate (as opposed to a cookie monster) I am not sure what i need to do - if any. Recall, there is no application in which Vanilla is embedded that generates cookies. All the cookies on my machine are generated by the local copy of Vanilla Forums and my general browsing activities on a workstation.
Am i missing something obvious?
why don't you use javascript? In what context is the the link?
grep is your friend.
if your server resets, then session data could be lost.
The cookie might still be there. You can check this.
grep is your friend.
Thanx00 and Thanks Tim.
Having created a test WordPress site from which to launch a URL to a VF site with my plugin this issue disappeared (as did another issue - reported in discussion Plugin Problems - Part 2).
Your help is much appreciated.