Franz
Franz

Reputation: 169

GAE: Uploading to Blobstore Service kills the Session

So I'm using GAE and created a session to persist some data between some JSP and servlets. The problem is when I access the Blobstore Service to upload a file, the session is killed and the user is logged out.

This is the form attributes that causes the problem: action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data"

Upvotes: 1

Views: 365

Answers (3)

MikeM
MikeM

Reputation: 1

If you use Eclipse for development, you can validate each of your jsps prior to deploying. If you clear all errors first, the compile errors will go away. I have been surprised at the errors the dev environment did not complain about, but prevented deployment.

Upvotes: 0

user3270443
user3270443

Reputation: 11

It seems that the session is being killed based on the blobstoreService.createUploadUrl("/test") changing the domain in the development environment. If i test using my dev machine IP address the session is destroyed as the call back URL results in computername:port/test rather than ipaddress:port/test. I f i use computername in the URL to submit the form originally the session remains and dev is happy.

Upvotes: 1

userC
userC

Reputation: 16

For anyone looking at this in the future, it seems this issue only happens when working in the local development server but not after deploying the app.

I had an identical issue while testing on my local dev server. Uploading files to the GAE Blobstore logged the user out and messed up the session. After I deployed my app, everything worked perfectly online. Wish I had tried that first before spending hours trying to find out how to fix it.

Upvotes: 0

Related Questions