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

G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

Thanks Manish, I 'll try to implement this and will post you if any problems.

Thanks & Regards,
Sachin Saki

Manish Bafna said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top