473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SessionState

Hi ,

I have created two Web Application - WebApplication1 and WebApplication2 in
same machine for testing purpose.
e.g
http://localhost/WebApplication1.aspx
http://localhost/WebApplication2.aspx

I have this setup for both WebApplication's Web.Config
<sessionState mode="SQLServer" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1; integrated security=true"
cookieless="true" timeout="20" />

ASP.NET State Service - Started

First, I created a Session Variable during the PageLoad e.g.
Session("Testing") = "This is for testing purpose"
Once I click a a button which
Response.Redirect("http://localhost/WebApplication2.aspx")
In WebApplication2, I am not able to retrieve the value of the Session e.g.
Response.Write(Session("Testing")). Why?

in SQL Server, since I am using the InstallPersistSqlState.sql so that I can
have the Session value store in the table for testing purpose. I found out
that the first Session created when PageLoad in WebApplication1, once I
click the button and redirect to WebApplication2, another new session
created.

Please help ....

Thanks,
Kenny
Nov 18 '05 #1
3 2346
Make sure both applications have the same machine key settings and make sure
the cookie name is the same.

Set up in web.config:
---------------------
<authentication mode="Forms">
<forms name="{CookieNameHere}" path="/"
loginUrl="login.aspx" protection="All" timeout="10" />
</authentication>

<machineKey
validationKey="{ValidationKey}"
decryptionKey="{DecryptKey}"
validation="3DES"
/>

If you leave at default, each server will create its own key. NOTE: You
cannot share session variables across apps (or at least I know of nobody who
has found a way), but you can use the session for a single sign on, as the
session ID will be the same.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Kenny" <ke***@hotmail.com> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I have created two Web Application - WebApplication1 and WebApplication2 in same machine for testing purpose.
e.g
http://localhost/WebApplication1.aspx
http://localhost/WebApplication2.aspx

I have this setup for both WebApplication's Web.Config
<sessionState mode="SQLServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1; integrated security=true"
cookieless="true" timeout="20" />

ASP.NET State Service - Started

First, I created a Session Variable during the PageLoad e.g.
Session("Testing") = "This is for testing purpose"
Once I click a a button which
Response.Redirect("http://localhost/WebApplication2.aspx")
In WebApplication2, I am not able to retrieve the value of the Session e.g. Response.Write(Session("Testing")). Why?

in SQL Server, since I am using the InstallPersistSqlState.sql so that I can have the Session value store in the table for testing purpose. I found out
that the first Session created when PageLoad in WebApplication1, once I
click the button and redirect to WebApplication2, another new session
created.

Please help ....

Thanks,
Kenny

Nov 18 '05 #2
Hi,

Is it very important to put the authentication mode?

This is my test scenario:
http://192.168.0.100/Test/WebForm1.aspx
http://192.168.0.100/Test/WebForm2.aspx

http://192.168.0.111/Test/WebForm1.aspx

both WebForm1.aspx will create a Session variable with value

http://192.168.0.100/Test/WebForm1.aspx have a button to load the
WebForm2.aspx and display the Session value

http://192.168.0.111/Test/WebForm1.aspx have a button to redirect to
http://192.168.0.100/Test/WebForm2.aspx and display the Session value

both have the same Web.Config

<sessionState mode="StateServer"
stateConnectionString="tcpip=192.168.0.100:42424" timeout="240" />
<machineKey
validationKey="37429795AA5F554C0DD89D815E3A428C865 046C666BC91798F52F31C24E6C
D231756FAE36890A0C5401B907CC887558C2838C21F8696D68 6A83EC65FF0E74DFD"
decryptionKey="32FD4B2E0C6D6F08E64B0A15CE5E05D6603 62A9A549D7F2C"
validation="3DES" />

both ASP.NET State Service started
Any idea why I still not able to retrieve the Session Value???

Thank you.
Kenny
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Make sure both applications have the same machine key settings and make sure the cookie name is the same.

Set up in web.config:
---------------------
<authentication mode="Forms">
<forms name="{CookieNameHere}" path="/"
loginUrl="login.aspx" protection="All" timeout="10" />
</authentication>

<machineKey
validationKey="{ValidationKey}"
decryptionKey="{DecryptKey}"
validation="3DES"
/>

If you leave at default, each server will create its own key. NOTE: You
cannot share session variables across apps (or at least I know of nobody who has found a way), but you can use the session for a single sign on, as the
session ID will be the same.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Kenny" <ke***@hotmail.com> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I have created two Web Application - WebApplication1 and WebApplication2

in
same machine for testing purpose.
e.g
http://localhost/WebApplication1.aspx
http://localhost/WebApplication2.aspx

I have this setup for both WebApplication's Web.Config
<sessionState mode="SQLServer"

stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1; integrated security=true"
cookieless="true" timeout="20" />

ASP.NET State Service - Started

First, I created a Session Variable during the PageLoad e.g.
Session("Testing") = "This is for testing purpose"
Once I click a a button which
Response.Redirect("http://localhost/WebApplication2.aspx")
In WebApplication2, I am not able to retrieve the value of the Session

e.g.
Response.Write(Session("Testing")). Why?

in SQL Server, since I am using the InstallPersistSqlState.sql so that I

can
have the Session value store in the table for testing purpose. I found out that the first Session created when PageLoad in WebApplication1, once I
click the button and redirect to WebApplication2, another new session
created.

Please help ....

Thanks,
Kenny


Nov 18 '05 #3
Even though I added this ... but still no able to retrieve the Session
Value.

<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="/WebForm1.aspx" protection="All"
timeout="240" />
</authentication>

"Kenny" <ke***@hotmail.com> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Hi,

Is it very important to put the authentication mode?

This is my test scenario:
http://192.168.0.100/Test/WebForm1.aspx
http://192.168.0.100/Test/WebForm2.aspx

http://192.168.0.111/Test/WebForm1.aspx

both WebForm1.aspx will create a Session variable with value

http://192.168.0.100/Test/WebForm1.aspx have a button to load the
WebForm2.aspx and display the Session value

http://192.168.0.111/Test/WebForm1.aspx have a button to redirect to
http://192.168.0.100/Test/WebForm2.aspx and display the Session value

both have the same Web.Config

<sessionState mode="StateServer"
stateConnectionString="tcpip=192.168.0.100:42424" timeout="240" />
<machineKey
validationKey="37429795AA5F554C0DD89D815E3A428C865 046C666BC91798F52F31C24E6C D231756FAE36890A0C5401B907CC887558C2838C21F8696D68 6A83EC65FF0E74DFD"
decryptionKey="32FD4B2E0C6D6F08E64B0A15CE5E05D6603 62A9A549D7F2C"
validation="3DES" />

both ASP.NET State Service started
Any idea why I still not able to retrieve the Session Value???

Thank you.
Kenny
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Make sure both applications have the same machine key settings and make

sure
the cookie name is the same.

Set up in web.config:
---------------------
<authentication mode="Forms">
<forms name="{CookieNameHere}" path="/"
loginUrl="login.aspx" protection="All" timeout="10" />
</authentication>

<machineKey
validationKey="{ValidationKey}"
decryptionKey="{DecryptKey}"
validation="3DES"
/>

If you leave at default, each server will create its own key. NOTE: You
cannot share session variables across apps (or at least I know of nobody

who
has found a way), but you can use the session for a single sign on, as the
session ID will be the same.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Kenny" <ke***@hotmail.com> wrote in message
news:uA**************@TK2MSFTNGP09.phx.gbl...
Hi ,

I have created two Web Application - WebApplication1 and WebApplication2
in
same machine for testing purpose.
e.g
http://localhost/WebApplication1.aspx
http://localhost/WebApplication2.aspx

I have this setup for both WebApplication's Web.Config
<sessionState mode="SQLServer"

stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1; integrated security=true"
cookieless="true" timeout="20" />

ASP.NET State Service - Started

First, I created a Session Variable during the PageLoad e.g.
Session("Testing") = "This is for testing purpose"
Once I click a a button which
Response.Redirect("http://localhost/WebApplication2.aspx")
In WebApplication2, I am not able to retrieve the value of the Session

e.g.
Response.Write(Session("Testing")). Why?

in SQL Server, since I am using the InstallPersistSqlState.sql so that
I can
have the Session value store in the table for testing purpose. I found

out that the first Session created when PageLoad in WebApplication1, once

I click the button and redirect to WebApplication2, another new session
created.

Please help ....

Thanks,
Kenny



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Flemming Jensen | last post by:
The idea behind this code is to standardize all my webpages in an application to look the same by inheriting the pages from a userdefined class. But it gives me problems regarding sessionstate... ...
2
by: mike parr | last post by:
I want to use cookies on my website, simply to identify the user when they come to my website (I will just be writing one for new users and reading from people who are already users when they reach...
5
by: Mikko Penkkimäki | last post by:
Hi Looks like I can not change Web page's timeout setting. In practise it's all the time 20 minutes - no matter what I do. I have this kind of setting in web.config: <sessionState...
3
by: Ralf Müller | last post by:
hi all! in my custom HttpHandler HttpContext.Current.Session is not set - why? greetings, ralf
2
by: ivanL | last post by:
In web.config, I can set SessionState mode to "Off" while using Forms authentication, they have 2 diff mechanisms, is this correct?
4
by: jensen bredal | last post by:
Hello, i was not able to find any documentation about the largest value one can assign the "timeout" attribute of the <sessionState section in web.config. any idea?
2
by: Philipp Schumann | last post by:
....BUT for _custom_ HttpHandlers. How can I do that? In my custom IHttpHandler, HttpContext.Current.Session is a null reference, and I can't use the session state. It is enabled in web.config...
7
by: Krishnan | last post by:
Hi, Could anyone please let me know how to read SessionState setting from the Web.Config file into an ASPNET application? TIA Krishnan
0
by: Mr Ideas Man | last post by:
Hi all, Relating to a post i made earlier... I am deploying a asp.net app to my web host. They assure me that the directory i am copying my files to is configured as an IIS Application. ...
0
by: Med | last post by:
Hi, My Settings in web.config: <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1; Trusted_Connection=yes"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.