By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,952 Members | 1,053 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,952 IT Pros & Developers. It's quick & easy.

How to Share Session State between .asp and .aspx page ?

P: n/a
I have asp application, from which I am redirecting user to .aspx page. I
want to use same sessions in .aspx application. When User clicks on Browsers
back button i.e. comes back from .aspx page to .asp page the same session
state i want to persist ? How to do this ??

Thanks in Advance
Sachin Saki
May 18 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,
You can share it with database.
Below link shows in very simplw way how to do this:
http://www.codeproject.com/aspnet/SessionTransfer.asp
hope this helps
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Sachin Saki" wrote:
I have asp application, from which I am redirecting user to .aspx page. I
want to use same sessions in .aspx application. When User clicks on Browsers
back button i.e. comes back from .aspx page to .asp page the same session
state i want to persist ? How to do this ??

Thanks in Advance
Sachin Saki
May 18 '07 #2

P: n/a
Hi Manish,

Thanks for your solution. But still I am not sure whether it will work when
user clicks on browsers back button. Because when user clicks back button, It
won;t make any post back or redirection so how to handle this scenario. I
guess i am able to explain what my concerns is ??

Thanks & Regards,
Sachin Saki
"Manish Bafna" wrote:
Hi,
You can share it with database.
Below link shows in very simplw way how to do this:
http://www.codeproject.com/aspnet/SessionTransfer.asp
hope this helps
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Sachin Saki" wrote:
I have asp application, from which I am redirecting user to .aspx page. I
want to use same sessions in .aspx application. When User clicks on Browsers
back button i.e. comes back from .aspx page to .asp page the same session
state i want to persist ? How to do this ??

Thanks in Advance
Sachin Saki
May 18 '07 #3

P: n/a
Hi,
In table we can add one more field(apart from three fields) which will
contain timestamp values. suppose you want to maintain session for one
hour.Then in both aspx and asp pages will retrieve all the values from
database at the very start and put into the session in a similar way.(there
must be check put in the place while we query database that timestamp is not
older than one hour and must not be null.If the session values are not null
in database for particular ID and timestamp is not older than one hour,it
means this is not the first time page is being loaded and we can safely put
session values(retrieved from database) into session variables in asp/aspx
pages.)
Hope i am able to explain you properly.
If you any doubts feel free to ask me
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Sachin Saki" wrote:
Hi Manish,

Thanks for your solution. But still I am not sure whether it will work when
user clicks on browsers back button. Because when user clicks back button, It
won;t make any post back or redirection so how to handle this scenario. I
guess i am able to explain what my concerns is ??

Thanks & Regards,
Sachin Saki
"Manish Bafna" wrote:
Hi,
You can share it with database.
Below link shows in very simplw way how to do this:
http://www.codeproject.com/aspnet/SessionTransfer.asp
hope this helps
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Sachin Saki" wrote:
I have asp application, from which I am redirecting user to .aspx page. I
want to use same sessions in .aspx application. When User clicks on Browsers
back button i.e. comes back from .aspx page to .asp page the same session
state i want to persist ? How to do this ??
>
Thanks in Advance
Sachin Saki
May 18 '07 #4

P: n/a
Hi,
In ID field of table you can store IP Address of Client Machine:
To get the IP address of the machine and not the proxy use the following code
Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Also when user clicks back button in our case it would be going to transfer
page where you can use Referer of Request.ServerVariables to know from which
page the user is coming.
I think you will be to do it if you paly around with it little bit
Hope this helps
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Sachin Saki" wrote:
I have asp application, from which I am redirecting user to .aspx page. I
want to use same sessions in .aspx application. When User clicks on Browsers
back button i.e. comes back from .aspx page to .asp page the same session
state i want to persist ? How to do this ??

Thanks in Advance
Sachin Saki
May 18 '07 #5

P: n/a
Thanks Manish, I 'll try to implement this and will post you if any problems.

Thanks & Regards,
Sachin Saki

"Manish Bafna" wrote:
Hi,
In ID field of table you can store IP Address of Client Machine:
To get the IP address of the machine and not the proxy use the following code
Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Also when user clicks back button in our case it would be going to transfer
page where you can use Referer of Request.ServerVariables to know from which
page the user is coming.
I think you will be to do it if you paly around with it little bit
Hope this helps
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Sachin Saki" wrote:
I have asp application, from which I am redirecting user to .aspx page. I
want to use same sessions in .aspx application. When User clicks on Browsers
back button i.e. comes back from .aspx page to .asp page the same session
state i want to persist ? How to do this ??

Thanks in Advance
Sachin Saki
May 23 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.