After deployment, login control stops working - asp.net-membership

In my development environment I can register and login just fine. After loging in or registering I do a redirect. Once deployed I noticed that the registering still works, but the page refreshes. Stranger still is the fact that when I try to log in, it also refreshes.
So basically, everything works - users still can register, the application can find the database, I can view public pages, etc. Just getting past the login (or register) page is not working. No redirect, just a refresh...
I run in IIS 6.0, SQL Server 2008, asp.net 4.0. I use membership and roles provided by asp.net.

Without more information, my best guess is a web.config problem. Make sure defaultUrl attribute set to your default page's name in the forms element of the web.config.

Related

Codeigniter Session data lost on the third navigation

This is a really strange problem. I have an application that I build using Codeigniter 3, HMVC, and Ion Auth. It was working well until I migrated it from one server to another. Now the data in the session is cleared after 3 navigations.
I tested it by logging into the application and watching the data field in the ci_session table as I navigated. I made it as simple as possible. I perform a browser refresh from the view I reach after login. On the third refresh, the data disappears from the database for my session and the application sends me back to the login page (application checks to see if the user is logged in). I even waited awhile (less than the 7200) to see if it was a time out and the time between refreshes does not seem to matter. I did not add code, because I do not know what code would help.
Does anyone have an idea what setting may be the cause?
Some time Codeigniter Session not working it has problem with PHP version
Change Your Server PHP Version.

Redirecting issues with spring and springmobile

I'm building a website using Spring and the SpringMobile extension.
I've configured the LiteDeviceDelegatingViewResolver with mobilePrefix = m/, tabletPrefix = t/ and enableFallback = true, so that, whenever a dedicated mobile (or tablet) view isn't available, the "normal" (desktop site) view is served.
The site has several sections and subsections. For instance, there's a Products section and several Categories within it.
Currently, there isn't a landing page for Products, so I redirect the user to the first Category. In other words, when the link to /products is clicked, the corresponding #Controller method redirects to /products/category1 (by returning "redirect:/products/category1"); then, the method mapped to /products/category1, serves the view (by returning "viewname").
This works as expected when using the desktop site. However, in the mobile site, whenever I try to browse to /products, I get automatically redirected to /m/products by SpringMobile (which is fine), but then my #Controller gets into action, and, instead of being eventually redirected to /m/products/category1, strangely I get redirected to /m/products/m//products/category1.
Any ideas on why is this happening, and on how to achieve the expected behavior?
P.S.: If I navigate directly to /m/products/category1, the desktop view (the fallback) is properly shown.
Well, it turns out this was a bug in SpringMobile(MOBILE-70, MOBILE-78) which was fixed in version 1.1.0.RC1. It also affected forward: redirection.
I've updated my project dependencies, and the issues appear to be gone for good.

How to get Orbeon Forms embedded into an ASP.Net MVC3 app?

Background
I'm investigating the use of Orbeon Forms to integrate into our
ASP.NET MVC3 web app by building a simple MVC3 app to figure stuff
out.
I have a Win2008 R2 std server running Tomcat 7 and Orbeon 3.9.1 PE
trial on our HyperV server. This is working and I can create forms and
then use the forms to submit data.
I've created an empty MVC3 app on my local dev machine. It has an
Index action on the Home controller that returns a page that has a
bunch of links to the add new URLs of some of my forms on the Orbeon
installation. The links access an Add action on the Home controller
which uses a WebRequest object with the ?orebeon-embeddable=true
querystring parameter tagged on the end to get the definition of the
Orbeon submit form page. I replace the relative URLs in what I get
back to make them absolute. I then insert that into a basic view and
display it.
Problems
HOWEVER! As soon as I do interact with the Orbeon form in anyway, e.g. click inside a single line textbox field (IE9) I get a JS error
in the script file "orbeon-[random guid style value].js" line 121 with
the line "AjaxServer.exceptionWhenTalkingToServer(e,formID)"
highlighted with the error being "formID is undefined".
I'm not sure where to start looking here as I am unfamiliar with
Tomcat and only know what I can decipher from the Orbeon docs.
Anybody tried to embed the form runner like this and experience this
error?
What I tried next
[Update]: The MVC Json() method got me thinking that perhaps the
Orbeon test site I set up on the VM did not like the fact it was
getting AJAX requests from the MVC app on my dev machine. With this in
mind I tried installing the CORS filter into the Orbeon app from
dzhuvinov.com. According to the docs after adding the relevant
config to the web.xml file the default behaviour is to pretty
unrestrictive, i.e. it should let everything through. Unfortunately
after restrating Tomcat this didn't help.
[Update 2]: Okay seems like the CORS docs are a bit out of date and
the defaults are seemingly the opposite so setting the initial values
for that seems to sort that out somewhat - although IE9 still gets the
JS error message. Meanwhile in FireFox 12 things are going better but
now the issue is how to pass the JSESSIONID cookie Orbeon sends me
back when I embed the runner in the MVC view such that when you
trigger any of the AJAX on the Orbeon form it sends the JSESSIONID
cookie as well.
Well I guess my title and info were slightly misleading so I may as well close my own question with the follow "answer".
In order to embed in an MVC3 app (read as any non-Java backend I would imagine) Orbeon Forms Runner and have it work I had to do the following:
Configure the CORS filter for my install of Orbeon Forms on Tomcat 7 (Dzhuvinov.com) to allow cross-domain AJAX.
In HTML partial's returned from Orbeon make relative URLs beginning /orbeon/xforms-server/ absolute calls to a custom proxy. Store the JSESSIONID in the ASP.NET MVC Session object.
Write controller actions for the proxy to handle requests. This simple proxy forward requests on to the Orbeon Forms install after setting the JSESSIONID cookie with the value stored in (2).

HTTPModule invoked on main page but not on sub-page

I am facing a strange error in MOSS 2007 running under Windows 2008. I have created a custom HTTP Module that fires on the application's OnAuthenticate event. It basically creates a custom cookie which is used by another application to authenticate the user, creating a single sign-on effect.
Everything went fine under the development server running Win2K3. However, on the staging server the following wierd things are happening:
a) The module seems to fire on the base page, i.e. https://conn.test.com/Pages/Default.aspx, however if somone goes into a sub-page directly like: https://conn.test.com/Operations/Pages/Operations%20Portal.aspx, it does not seem to fire.
b) The module gets fired from IE but not from Firefox or Chrome. The only difference between the two seems to be that a certain webpart loads and works in IE but does not seem to load or work in Chrome or FF.
Can someone help explain the behaviour of this. The HTTPMOdule overrides the AuthenticateRequest event of the application.
Sorry got this figured out. The problem is that the Init method of the event handler for OnAuthenticate works with privileges of the underlying ASP.NET user, but the main event handler delegate works with the credentials of the authenticated user.
I had written some code t log on to an Event Log and apparently this needs higher level privileges. This was the reason the module's delegate was firing but nothing was getting logged.
My guess is that the webpart on the main page ran with privileges of some other user who had the necessary access rights and hence things worked there. Since it does not work in FF or Chrome the module did not work in those browsers. Also the sub-pages do not have the webpart, hence directly going onto them, also causes the problem.
The issue got sorted after I added SPSecurity.runWithElevatedPriviliges around the logging code.

Sharepoint with ASP.NET Ajax

I'm running a MOSS2007 Sharepoint website with .NET 3.5 Ajax. I'm using the SmartPart webpart to host a user control that contains an update panel.
I've added the script manager to the /_catalogs/masterpage/default.master file and it works fine when I log in as myself. But when I log in as a normal user I get the error message The control with ID 'UpdatePanel1' requires a ScriptManager on the page.
As far as I can tell, it's loading a different version of the masterpage for the different users (a user control with this.Page.MasterPageFile consistently returns /_catalogs/masterpage/default.master) but other edits I've made as tests don't show either...
Is there's any way to easily add a script manager to all master pages for all users (I'd rather have it on a page and not used, than needed on a page and not there)?
My stupid mistake. Needed to approve the new master page version after checking it in.

Resources