会话和Cookie在Windows Azure云环境中不起作用 [英] Session and Cookies not working on Windows Azure Cloud environment
问题描述
我已将网站迁移到云,该站点可以使用计算和存储模拟器在我的本地计算机上完美运行。
I have migrated a website to cloud, which works perfectly on my local machine using the Compute and Storage Emulators.
但是,当我将其放到Windows Azure云上时,会话和Cookie无法正常工作。以下是web.config文件的一部分。
However, when I put it onto Windows Azure Cloud, the session and cookies are not working fine. Part of web.config file is given below.
<sessionState timeout="30"
mode="SQLServer"
sqlConnectionString="Server=sxxxxxxxxx.database.windows.net;User ID=xxxxx@sxxxxxxxxx;Password=MY_PASSWORD"
cookieless="false"
allowCustomSqlDatabase="true" >
</sessionState>
任何人都可以引导进入纠正相同吗?网站上的所有其他内容都可以正常工作。
Can anyone please guide be in correcting the same ? All the other things in the website are pretty much working fine.
以下是一些其他信息:
总而言之,我已经完成了以下工作。
To summarize, I have done the following.
-
将网站迁移到Windows Azure成功
Migrated a website to Windows Azure successfully
成功创建数据库访问所需的连接字符串。
Created the required connection strings for the database access successfully.
测试了
当我发布网站并上传packageFile和configurationFile时,一切正常。但是
When I published the website and uploaded the packageFile and configurationFile, everything was working fine in general. BUT
用于使用会话/ cookie的页面。所有静态页面都运行良好。所有数据库访问都是正确的。
for the pages which used session/cookies. All static pages worked well. All database access were proper.
- 然后,我写了一些代码来正确设置会话。
错误和整个网站停止工作
GOT ERRORS AND ENTIRE WEBSITE STOPPED WORKING
- 创建所需的数据库和表(ASPSTATE数据库及其对应的表)。一切顺利。
http://blogs.msdn.com/b/sqlazure/archive/2010/08/04/10046103.aspx
测试了网站...仍然在本地和云上出现错误...如本文中先前所述。
Tested the website ... Still getting the error on local and on cloud...as mentioned previously in this post.
可以吗
推荐答案
。大家好,
感谢您的回复。我在web.config中稍微修改了会话状态,如下所示
Thanks for the replies. I modified the session state in web.config a little and its as below
<sessionState cookieless="false" mode="SQLServer"
sqlConnectionString="data source=serverName.database.windows.net;user id=UserID@serverName;password=password;Trusted_Connection=False;Encrypt=True;"
timeout="20"
allowCustomSqlDatabase="true">
</sessionState>
现在可以使用了。
注意
Sandeep
Regards Sandeep
这篇关于会话和Cookie在Windows Azure云环境中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!