473,387 Members | 1,619 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,387 software developers and data experts.

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

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
5 4062
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
2
by: VB Programmer | last post by:
I've read that you can save a session state variable created by an ASP page into a db so that the value of the session state variable can be read/used by an ASP.NET webform. Question: Let's say...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
7
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below,...
9
by: cashdeskmac | last post by:
I have put a string into Session and tried to retrieve it on the next page I visit but the Session appears empty. I have exactly the same spelling for both adding and retrieving the value: ...
13
by: Laurahn | last post by:
How can i configure my application for closing the session ? How can i use the session end for closing the session ?
8
by: Andrew Teece | last post by:
Hope someone can help. We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm. The application uses the ReportViewer control in local mode, hence we need session state. Because we...
11
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each...
4
by: Cirene | last post by:
In my web.config I added <pages enableSessionState="true">. In each of my pages I also added EnableSessionState="True" to the Page declaration. (I didn't think this was necessary, but...) ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.