473,583 Members | 4,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4073
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(retrieve d 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.ServerV ariables["HTTP_X_FORWARD ED_FOR"];
Also when user clicks back button in our case it would be going to transfer
page where you can use Referer of Request.ServerV ariables 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.ServerV ariables["HTTP_X_FORWARD ED_FOR"];
Also when user clicks back button in our case it would be going to transfer
page where you can use Referer of Request.ServerV ariables 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
2372
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 - perhaps I'm just not very smart or perhaps MS is making this too hard for us sql bunnies to understand - I dunno, but I'd really appreciate someone...
2
1408
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 the session variable is called "UserIsAdmin" and the ASP page is the login page. When the person logs in as 'admin' it stores the session variable...
13
2808
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 visit again .... null ... again .... it works ..... again ... it works ... again ..... null....... and so on and on .... it does randomly work or...
7
2033
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, it retreives the Menu from session and assigns its reference to Menu1. Within the Page_Load event I can see its internal values which have been...
9
2207
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: Session = "john"; On the next page: txtName.Text = Session;
13
2084
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
5343
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 dont wan't a single point of failure we use SQL Session State. I have setup a persistant sql session state database on a SQL 2000 server (this is...
11
3631
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 method has the WebMethodAttribute.EnableSession set to true. When I run the test page the session is maintained. However, using a console...
4
2509
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...) Any reason why even though I did this I keep getting this error.... Server Error in '/abc' Application.
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8179
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7933
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5700
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5372
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1431
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1155
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.