i made some changes and now URL seems to be this :
http://localhost:59581/(S(hkbcdzijjyd3ou2ba5qq3zct))/SearchAvailability
' hkbcdzijjyd3ou2ba5qq3zct ' changes with different tabs .
what i did is added following code in web.config :
<system.web>
<sessionState timeout="15" cookieless="true" regenerateExpiredSessionId="false" />
</system.web>
Now there is another problem, and P.S. : i am using SignalR also .
The thing with Timer . I want each session to be associated a timer . That time has timeout period and has timer function which automatically executes when timer has elapsed 14min. Till this is working fine. I have defined timer in MyHub of SignalR. but now how do i stop timer when user logoff?
- - - Updated - - -
when i start timer , it is done using object of MyHub class. But when i want to stop i dont have that object reference. Its gone.what to do?
-NEED TO HAVE PER TIMER PER SESSION_ID
-WHEN USER CLOSES TAB then to its TIMER SHOULD GET STOP
here is the code:
public class MyHub : Hub
{
CuePOSStagingEntities db = new CuePOSStagingEntities();
public Timer timer1;
public static int session_warning_time = 14;
public static int session_expiration_time = 15;
public DateTime last_activity;
public void InitTimer(int SelectedCompany)
{
//if (IsStop==true)
//{
// timer1.Stop();
//}
timer1 = new Timer();
// timer1.Elapsed += new ElapsedEventHandler(check_session);
timer1.Elapsed += new ElapsedEventHandler((sender, e) => check_session(sender, e, SelectedCompany));
timer1.Interval = 60000; // in miliseconds
timer1.Start();
timer1.Enabled = true;
last_activity = DateTime.UtcNow;
}