1

I am creating the session in class file of the first application and need to access the same session in second application both of the applications are presented in the same solution. when i am trying to do this session in second application getting null but session contain data in the first application.

In first Application

System.Web.HttpContext.Current.Session["key1"] = "a";

In second application

if (HttpContext.Current.Session["key1"]!= null) //i am getting session as null hear

How is it possible to send the session data from one application to another application with in the same solution?

please some one help me..

  • Exact duplication of http://stackoverflow.com/q/2868316/30594 – Ramesh Apr 06 '12 at 09:31
  • I dont want any database call – Ranaprathap Apr 06 '12 at 09:40
  • Is there any reason why you don't want to use DB? – Ramesh Apr 06 '12 at 09:50
  • Check this link http://weblogs.asp.net/lichen/archive/2011/10/05/sharing-session-state-over-multiple-asp-net-applications-with-asp-net-state-server.aspx . But I would prefer not going down that approach. – Ramesh Apr 06 '12 at 09:53
  • I am trying to store some URL in that session and I want the same URL on my second application. without using session if is there any better way to get then plz tell me. – Ranaprathap Apr 06 '12 at 09:54
  • You can encrypt and store the information in a cookie and read the same in the second application. This will work if your applications run in the same domain. Also, ensure the url passed cannot be tampered and is safe from replay attacks. Other way is to pass this encrypted information using query string / cross page postback. But what ever you do, safe guard it from replay attacks by attaching time stamp before encrypting and compare the same after decrypting. – Ramesh Apr 06 '12 at 10:03

0 Answers0